Info

How the profiler works, what the numbers mean, and how grades are assigned.

How data is collected

FiveM has a built-in profiler that works at the C++ runtime level. You do not need to touch any script. When you run profiler record 300, FiveM's Citizen Lua scheduler wraps every thread tick in every resource with precise timing automatically.

The runtime tracks which resource owns each Lua coroutine, so it records execution time for all of them including escrowed resources. The resource name is never encrypted, only the code inside it, which is why you see entries like Escrowed (qbx_core).

When recording stops, run profiler saveJSON myprofile. Download that file from your server and upload it here.

Server ticks and the 50ms budget

A FiveM server runs at 20 ticks per second, one tick every 50ms. Within each tick, every resource's threads, event handlers, and commands run one after another.

The profiler groups events into ticks by looking for gaps over 15ms between consecutive events. That gap is the server sitting idle waiting for the next tick cycle. Everything within a gap is counted as one tick.

The script time per tick in the results is the total Lua execution time across all resources in a single tick. 5ms per tick is fine. 40ms per tick leaves almost no room for networking and entity sync, which is when players start feeling lag.

Heavy ticks

A tick is marked as heavy when total script execution goes over 25ms. That is half the 50ms budget. Once scripts are using more than half the budget, there is very little left for everything else the server needs to do.

The timeline chart shows every tick as a bar. Green is fine, yellow is getting close, red is a heavy tick. Hover over any bar to see what was running during that tick.

Top 20 Worst Scripts

CPU HOG

Most total CPU time across the whole recording. This script ran a lot, ran slow, or both. Start here when looking for what is dragging down your server.

SPIKE

Worst single tick recorded. A script can look fine on average but spike hard once in a while, often from a database query, iterating over all players, or a callback with no caching. These spikes are usually what players actually feel.

HITCH DRIVER

Shown up during heavy ticks. This counts how many times a resource was in the top runners during a flagged tick. It does not have to be the biggest script, it just keeps showing up when things go wrong.

Grades

Based on average script time per tick and percentage of heavy ticks.

Excellent

Under 5ms per tick, under 1% heavy ticks. Scripts are using a very small slice of the budget.

Good

Under 10ms per tick, under 5% heavy ticks. Normal load with minor spikes. Nothing needs to change.

Fair

Under 20ms per tick, under 15% heavy ticks. Scripts are taking up a real chunk of each tick. Worth checking the top offenders.

Poor

Under 30ms per tick, under 30% heavy ticks. High load. Players are likely noticing issues. Start optimising.

Critical

30ms or more per tick, or 30% or more heavy ticks. The server cannot keep up. Lag and desync are expected.

Recording a profile

  1. 1. Open your txAdmin console
  2. 2. Run profiler record 300
  3. 3. Wait about 15 seconds for it to finish
  4. 4. Run profiler saveJSON myprofile
  5. 5. Download the file from your server's resources folder
  6. 6. Upload it on the Analyze tab

Record while players are online for accurate results.

Credits

Created by

MonkeyWhisper

Sponsored by

1of1 Servers

Game Enterprise DDoS protection, NVMe storage, and low-latency nodes.

Free tool

No account needed. Share results with a link.

HOSTING
Your server deserves better than lag. Game Enterprise DDoS protection, NVMe storage, and low-latency nodes.
View plans