Most FiveM server lag comes from one resource taking too long on the server. Your console tells you when it happens, and the built-in profiler shows which resource is behind it. First check that the problem really is server lag, because FPS drops and network lag need different fixes.
Server lag, FPS drops and network lag
Server lag hits everyone at the same time. Cars rubber-band, doors open late and actions hang for a moment. FPS drops hit one player, or players on weaker PCs, often only in busy areas. Network lag shows up as high ping for some players and not others.
A few quick checks tell them apart. A player can type cl_drawfps true in the F8 console to see their frame rate. On the server console, the status command lists connected players with their ping. If one player has bad ping and everyone else is fine, the problem is their connection.
Read hitch warnings
Open your server console and look for lines like “server thread hitch warning: timer interval of 195 milliseconds”. The number changes each time. You may also see the same warning for the sync or network thread.
The Cfx.re fact sheet says hitch warnings mean one of your resources is not performing as it should. It names two common causes: SQL queries that take a long time and loops that hold up script execution.
Note when the warnings appear. If they show up every time a job pays out or a player joins, look at the script behind that action first. If they come and go with no pattern, you need the profiler.
Check resource usage with resmon
resmon is the resource monitor. Type resmon true in the F8 console and it lists each resource with its CPU time in milliseconds and its memory use.
It runs in the game, so it shows what each resource costs on the player’s side. That makes it the right tool for FPS drops. On the normal FiveM build it is a developer command. If you see “Access denied for command resmon”, add +set moo 31337 to your FiveM shortcut and launch again.
Watch which resources stay near the top while you stand still, then walk into a busy area and compare. A resource that is heavy everywhere is a better suspect than one that spikes for a second.
Record a server profile
For server lag you need the profiler. It works in the server console as well as in the game. Start recording while the lag is happening.
- Type profiler record 500 in the server console. 500 is the frame count the Cfx.re guide suggests starting with.
- Type profiler status to check that it is recording and how many frames it has.
- Type profiler saveJSON lag.json to save the profile next to your run.bat.
- Open Chrome, press Ctrl+Shift+I, open the Performance tab, right-click it and load the file.
On a server, profiler view prints a link instead of opening Chrome. Copy that link into Chrome yourself. Keep the server running if you view a profile you haven’t saved.
In the timeline, zoom into the frames where the lag happened and look for the longest blocks. Write down which resource each one belongs to. Those are your suspects.
Usual suspects
- Database calls that wait on slow queries.
- Loops that run more often than they need to.
- A resource you added or updated just before the lag started.
- The same script started twice under two folder names.
- Scripts that send events to every player at once.
To confirm a suspect, stop it with stop followed by the resource name on your test server, then record again. Avoid stopping core resources on a live server with players online.
How to measure any anticheat’s cost yourself
Anticheats get blamed for lag a lot. Some deserve it, some don’t. The honest answer comes from your own server, with your own resources and players.
- Record a server profile with the anticheat running, using the same frame count each time.
- Record a second profile with it stopped, on your test server or in a quiet hour with staff watching.
- Keep the player count and the time of day as close as you can between the two.
- Compare how much time the anticheat’s resource takes in each frame.
- Ask two or three players to run resmon to check the game side as well.
Every resource uses some time, so treat claims of zero impact with care. Ask the vendor how you can profile it yourself. Daddy Shield’s protections mostly react to things the game already reports, like shots and damage, and you can switch off any you don’t need. Profile it the same way.
How to choose a FiveM anticheat: 12 questions to ask
Fixes in order of payoff
- Remove resources you no longer use. Every started resource has some cost.
- Update the resource the profiler points at, or send its author the saved profile.
- Speed up slow database queries, or move them out of events that run often.
- Slow down loops that don’t need to run every frame.
- Keep one copy of each script and check server.cfg for duplicate start lines.
- Look at hardware last, once the profile shows no single resource to blame.
Clean up your server.cfg while you’re in there
FAQ
Does an anticheat cause lag? Any resource can add some load. Profile your server with and without it before you decide.
Why does resmon say access denied? It is a developer command. Launch FiveM with +set moo 31337 added to the shortcut.
Is one hitch warning a problem? A single warning matters less than a steady stream. Repeated warnings point to a resource worth profiling.
What should I send my developer? The saved profile file, the hitch warning lines and the time the lag happened.
Still choosing an anticheat? Run the same test on Daddy Shield within its 7-day refund window.