Engineering
resmon: finding the resource that is eating your frames
How to use the FiveM resource monitor (resmon): opening it in F8, what CPU msec, time % and memory mean, what good numbers look like, how to find a bad resource, and what to fix once you have found it.
Overview
When players say the server “lags”, they usually mean their frame rate drops — and on the client that is very often one or two resources doing too much work every frame. The resource monitor, resmon, shows exactly how much time each resource takes. Learning to read it turns vague complaints into a specific file you can fix.
Opening resmon
- Join the server and press F8 to open the client console.
- Type
resmon 1and press Enter. The monitor appears over the game. - Close the console with F8; the monitor stays until you run
resmon 0.
What the columns mean
| Column | Meaning |
|---|---|
| Resource | The resource name |
| CPU msec | Script time per frame, averaged — the number that matters most |
| Time % | Share of total frame time |
| Memory | Script memory used by the resource’s runtime |
| Streaming | Memory used by assets the resource streams |
Remember the budget: at 60 fps a frame is 16.7 ms for everything — rendering, physics and every script. A resource using 2 ms is taking an eighth of the entire frame on its own.
What good numbers look like
| CPU msec (idle) | Verdict |
|---|---|
| 0.00 – 0.02 | Excellent — the resource sleeps when it has nothing to do |
| 0.03 – 0.10 | Fine for UI-heavy resources such as a HUD |
| 0.10 – 0.50 | Worth checking; often a loop that could sleep longer |
| > 0.50 constantly | A problem — look at its loops now |
01Finding the culprit
- Stand somewhere neutral and note the baseline: everything should be near zero.
- Reproduce the lag — drive through the city, open the phone, stand near the job center.
- Watch which resource’s CPU msec rises and stays up.
- Stop that resource (
stop namein the server console, on a test server) and confirm the frame rate recovers. - Open its client files and look for
Wait(0)loops that do work regardless of distance.
The server side
resmon measures the client. Server-side cost shows up as “server thread hitch” warnings and is measured with the server profiler and txAdmin’s performance charts — see the profiler guide.
Frequently asked questions
How do I open resmon in FiveM?
Press F8 and type resmon 1. Type resmon 0 to close it.
What is a good resmon value?
Idle resources should use about 0.00–0.02 ms. Constant values above roughly 0.5 ms point to a problem.
Does resmon show server performance?
No, it shows the client. Use the server profiler and txAdmin for server-side performance.
Why is my HUD using 0.1 ms?
HUDs update often, so a little is normal. If it is much higher, it probably updates every frame when it only needs to update a few times a second.
Need this built, not just explained?
Ten years of FiveM work, from Lua to NUI
Custom resources, React NUI, ESX / QBCore / Qbox integration, OneSync performance audits and security reviews — plus the websites and SEO around your server brand.
Related guides
- EngineeringThreads and Wait in FiveM: loops that do not eat framesCreateThread(fn) starts a coroutine that runs alongside the game; Wait(ms) pauses it and lets everything else run. Wait(0) resumes on the next frame, so the loop runs every frame (60+ times a second). Use it only while you must draw or read input every frame; otherwise sleep for hundreds of milliseconds, and make loops adaptive — fast when the player is near something, slow when they are not.
- EngineeringUsing the FiveM profiler to find slow codeRun profiler record 500 in the server console (or F8 on the client) to record about 500 frames, check progress with profiler status, then run profiler view to open the result in Chrome, or profiler saveJSON name.json to save it. In Chrome DevTools’ Performance tab, look for tall frames and hover the coloured blocks to see the resource, file and line.
- EngineeringFiveM server optimizationRead resmon properly, kill per-frame loops, tune OneSync and entity limits, and find the database query that is freezing your server.