This resource helps you monitor the performance of your FiveM/QBCore server by logging the top 10 scripts that consume the most CPU time. By identifying poorly performing scripts, you can optimize them to ensure your server runs smoothly.
- Automatically monitors CPU usage of all server resources.
- Logs the top 10 scripts with the highest CPU usage.
- Runs every 10 minutes by default.
- Logs results to a file and sends notifications to a Discord channel.
- Ability to use 3rd party APis to gather tick and other performance info
- Additional performance logic
-
Download or Clone the Repository:
- Download the repository as a ZIP file and extract it.
- Or clone the repository using Git:
git clone https://github.com/yourusername/fivem-performance-analyzer.git
-
Place in Resources Folder:
- Place the
fivem-performance-analyzer
directory into your server'sresources
folder.
- Place the
-
Configure Webhook URL:
- Open
config.lua
and replaceYOUR_DISCORD_WEBHOOK_URL
with your actual Discord Webhook URL.
- Open
-
Add to server.cfg:
- Open your
server.cfg
file and add the following line to ensure the resource starts with the server:ensure fivem-performance-analyzer
- Open your
-
Start Your Server:
- Start or restart your FiveM server.
Once the server is running, the fivem-performance-analyzer
script will automatically execute every 10 minutes. It will log the top 10 poorest performing scripts to the console, to a file (performance_log.txt
), and send a notification to your specified Discord channel.
By default, the script runs every 10 minutes (600,000 milliseconds). If you want to change the frequency, edit the Wait
time in the server.lua
file.
- FiveM Server: This resource requires a FiveM server to run.
Running a FiveM server can be resource-intensive, especially with many scripts running simultaneously. Identifying and optimizing poorly performing scripts is crucial for maintaining a smooth and enjoyable experience for your players. This script helps you keep an eye on resource consumption and make necessary adjustments.
- Server Lag: If your server is experiencing lag or high CPU usage, this script can help pinpoint the problematic scripts.
- Regular Maintenance: Use this as part of your regular server maintenance routine to ensure optimal performance.
If you're experiencing issues with your FiveM server, here are some common troubleshooting steps:
-
Check Server Logs:
- Review the server logs for any error messages or warnings that could indicate the source of the problem.
-
Resource Performance:
- Use this performance analyzer script to identify and address poorly performing resources.
-
Update Resources:
- Ensure all your resources are up to date. Developers often release performance improvements and bug fixes.
-
Database Optimization:
- Optimize your database queries and ensure your database server is running efficiently.
-
Network Issues:
- Ensure your server has a stable and fast internet connection. Check for any network-related issues.
-
Restart Server:
- Sometimes, a simple server restart can resolve various issues.
-
Community Support:
- Utilize the FiveM forums and Discord communities for additional support and advice from other server owners.
Ensure that your server meets the general hardware requirements for running a FiveM server. If you're hosting a large number of players, you may need to adjust your hardware to accommodate the increased load. For more detailed requirements, you can refer to the FiveM Server Requirements documentation.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request with any improvements or bug fixes.