FiveM server performance: fix lag and low FPS

FiveM servers run at a tick rate of 64 per second (64 FPS). Every tick, the server calculates player positions, vehicle states, NPC behaviour and the logic of every running script. When the FPS drops below 30, players experience desync: vehicles teleporting, shots not registering and interactions that feel broken. This guide covers the most common causes and how to fix them.

Checking server FPS

In txAdmin, the dashboard shows the current server FPS. The ideal value is 64; anything above 50 is acceptable. Below 30 means there is a serious problem that needs attention.

The most common causes

1. Too many or poorly written scripts

This is the number one cause. Every resource executes code on every tick. A script that costs 0.5 ms per tick sounds harmless, but with 100 scripts you are already at 50 ms per tick, which limits the server to 20 FPS.

Solution: use the command resmon 1 in the console or txAdmin. This shows CPU usage per resource. Sort by usage and investigate the heaviest scripts first. Replace or remove anything that consistently tops the list.

2. Client-side scripts running server-side

Scripts meant for the client (UI elements, HUD, NPC rendering) belong in client.lua, not in server.lua. A client-side NPC spawner that accidentally runs server-side computes the NPC for every connected player, overloading the server with work that should happen on the client.

Solution: review the fxmanifest.lua of heavy scripts. Make sure client scripts are listed under client_scripts and server scripts under server_scripts.

3. Unoptimised database queries

Synchronous database calls block the server thread until the response comes back. Always use asynchronous queries through oxmysql. Add indexes to columns you search on frequently (identifier, citizenid). A query without an index on a table with 10,000 rows introduces noticeable lag on every call.

4. Too many streamed assets

Custom vehicles, clothing, maps and props all need to be sent to every connecting player. Hundreds of custom vehicles and extensive MLO interiors increase load times and memory usage for both the server and the client.

Solution: remove unused assets. Compress textures where possible. Audit your streaming folder for files that no active script references.

5. OneSync settings

OneSync is FiveM's network synchronisation system. Without it, the player limit is 32 and performance is worse. Make sure OneSync is enabled:

set onesync on

Infinity mode scales better with many players. Avoid the legacy mode unless you have a specific reason to keep it.

Optimisation checklist

  • Remove scripts nobody uses or that duplicate functionality already covered by another resource.
  • Use Wait() or Citizen.Wait() in loops. A loop without a wait runs every single tick and wastes CPU for no benefit.
  • Cache frequently used values instead of fetching them every tick. Player coordinates, for example, do not change meaningfully between consecutive ticks.
  • Use events and callbacks instead of polling (checking a condition on every tick).
  • Restart the server daily. FiveM servers accumulate memory over time through script leaks that are difficult to trace.
  • Keep your artifacts up to date. Performance improvements land in new artifact builds regularly.

Measuring improvement

After making changes, monitor server FPS for at least an hour during peak player count. A single measurement with two players online tells you very little. The real test is whether FPS stays above 50 when the server is full and players are spread across the map doing different things.

How many scripts is too many?

There is no fixed number. It depends entirely on quality. A server with 50 well-written scripts can outperform one running 20 poorly coded ones. Use resmon to identify the heaviest resources and focus your optimisation effort there.

Does more RAM help with lag?

Only if the lag is caused by memory shortage (the server swapping to disk). In most cases, CPU is the bottleneck, not RAM. More RAM helps when you have many streamed assets, but it does not improve script performance.

Can I lower the tick rate?

No. FiveM always runs at 64 ticks per second. If the server cannot keep up, the FPS drops. The solution is to reduce the workload, not to lower the target.

Should I upgrade to a better server?

Upgrade only after you have optimised. Moving to a faster server does not fix a badly written script that consumes 10 ms per tick. Optimise first, then upgrade if you still need more headroom. That said, single-thread CPU performance is the most important spec for a FiveM server.

FiveM servers with guaranteed CPU allocation run on the FiveM plans at HostValues.


Still stuck? Open a support ticket and our team will help you out.

Back to the blog