The Profiler is a very useful and easy-to-use tool for measuring your server's performance. You can use it to check code and threads that may be causing performance issues. This can happen, for example, because of poorly developed resources or similar issues. The Profiler is integrated directly into the server software.
Using the FiveM Profiler is pretty simple. Just enter the commands profiler record 100 and profiler view in the live console. This creates a profile with 100 frames, which you can open using the link in the console.
On current server versions, the link from profiler view points to an address like https://deprecated-….users.cfx.re/profileData.json that can no longer be reached, so the page stays empty. The profile data is stored on your server, and you can open it directly:
- Run
profiler record 100and thenprofiler view. Only then does the server provide the file. - Open
http://<Server-IP>:<Port>/profileData.jsonin your browser (the IP and port players use to connect) and save the file with Ctrl+S. If you have setsv_profileDataToken, add?token=<Token>to the address. - Open the developer tools in Chrome (F12), switch to the Performance tab and click Load profile (arrow pointing up). Select the saved file.
The Profiler shows you information about individual activities (ticks) that you should take a closer look at. Select a range of ticks and zoom in. You can then see which processes ran during those ticks and how long they took.
This also helps you identify which resources are taking up a lot of time. Resources that take more than 6 ms in total may cause issues.
