Guide

FiveM Profiler: Find Server Lag and Hitch Warnings

Record a FiveM server profile with the built-in profiler, open it in your browser and find the resources that cause hitch warnings, rubberbanding and desync.

Rubberbanding cars, delayed doors and a console full of server thread hitch warning messages all point to the same problem: something keeps the FiveM server thread busy for too long. Guessing which resource it is wastes hours. The built-in profiler tells you in a few minutes.

Signs that your server thread is overloaded

  • Players rubberband or see other players teleport.
  • Doors, inventories and menus react with a delay.
  • The server console prints server thread hitch warning: timer interval of ... milliseconds.
  • Problems get worse when more players are online.

If only one player has low FPS while everyone else is fine, the problem is on that player's PC, not on the server. See the client section below.

Record a profile on the server

The profiler is built into FXServer. You need no extra resource. Run these commands in the server console (the txAdmin Live Console works too):

profiler record 500

This records the next 500 frames, which is a good start. Record while the lag is happening, for example at peak time. profiler status shows whether the capture is still running. When the console reports that recording has stopped, save the result:

profiler saveJSON profile.json

The file is written to the folder the server was started from, next to run.bat or run.sh.

Open the profile in your browser

Open the FiveM Profiler Viewer and drop profile.json on the page. The file is read in your browser and is not uploaded. You get:

  • tick time statistics for the whole recording,
  • a table of resources with Total, Self, Avg/tick and Max time, sortable by any column,
  • every tick that took 50 ms or more marked as a hitch.

Click a resource to see its individual events. You can also open the same file in the Performance tab of Chrome DevTools if you want the full timeline.

Read the results

Start with the resource at the top of the table when you sort by Total. A resource that is high on Total or Avg/tick costs you something on every tick. A resource that is high on Max causes the occasional big hitch.

Typical causes:

  • loops that run every tick and go through all players, vehicles or objects,
  • database queries that the script waits on inside a hot loop,
  • encoding or decoding large JSON tables often,
  • events that are triggered far more often than needed.

Fix or replace the worst resource, record a new profile under similar load and compare. Change one thing at a time, otherwise you cannot tell what helped.

When no single resource is to blame

If tick times are high but the time is spread evenly across many resources, the server may simply not get enough CPU. The FiveM server thread depends mostly on single core speed, and shared CPU cores on cheap plans slow it down when neighbours are busy. Our FiveM hosting guide explains how to check whether your cores are really dedicated.

Client lag is different: use resmon

For low FPS on one PC, press F8 in FiveM and type resmon 1. It shows how much client CPU time each resource uses on that machine. That helps with client scripts, but it says nothing about the server thread. For that, use the server profiler above.

Frequently asked questions

How many frames should I record?

Start with 500 frames during a laggy moment. If the hitch is rare, record more or repeat the capture a few times.

Does the profiler slow down my server?

Recording adds a little overhead while it runs. A short capture is safe on a live server, but do not leave it running all the time.

Is my profile uploaded when I use the FiveM.tools viewer?

No. The viewer reads the JSON file in your browser. Nothing is sent to our server.

What does "server thread hitch warning" mean?

It means the server thread could not keep its schedule because one tick took too long. The profiler shows which resource was running during those long ticks.

Want to share your server with players? See how players find a FiveM server IP from a cfx.re link.

FiveM.tools was founded with sponsorship from Nyru.