ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
Performance

How to Use resmon to Find the Scripts Lagging Your FiveM Server

If your FiveM server feels sluggish โ€” rubber-banding, stutters, players complaining about lag โ€” the cause is almost always one or two badly optimized resources dragging everything down. The good news is that FiveM has a built-in tool that shows you exactly which ones. It's called resmon, and learning to read it is the single most useful performance skill a server owner can have.

What resmon is

resmon is FiveM's built-in resource monitor. It shows a live, per-resource breakdown of how much CPU time and memory each script on your server is using. Instead of guessing which resource is causing lag, resmon lets you *see* it.

How to open resmon

  1. Join your server as normal.
  2. Press F8 to open the console.
  3. Type resmon 1 and press Enter.
  4. An overlay appears listing every running resource with its CPU cost.

Press F8 again to close the console; the overlay stays up. To hide it, type resmon 0.

Reading the numbers

The column that matters most is CPU time, measured in milliseconds (ms) per tick. This is how long a resource takes to do its work each frame. The lower, the better.

Here's a rough guide to interpreting what you see:

  • 0.00โ€“0.01 ms โ€” Excellent. A well-optimized script sitting idle should be here.
  • 0.01โ€“0.10 ms โ€” Fine. Normal for an active resource doing real work.
  • 0.10โ€“0.50 ms โ€” Worth a look, especially if the resource is idle.
  • Above 1.0 ms consistently โ€” This is a problem. Investigate or replace it.

The key insight: sort by CPU time and look at what's high while idle. A script that costs 2ms even when nobody is interacting with it is poorly written โ€” it's probably running a loop every frame without a wait.

The most common cause of lag

Nine times out of ten, the culprit is a loop running every frame with no delay. In Lua, this looks like:

-- BAD: runs every single frame, pins a core
CreateThread(function()
  while true do
    UpdateSomething()
  end
end)

versus the correct version:

-- GOOD: runs every 5 seconds instead
CreateThread(function()
  while true do
    UpdateSomething()
    Wait(5000)
  end
end)

A single while true do with no Wait() can add 5โ€“15ms to every frame on its own. If resmon shows a resource pinned high, this is usually why.

Client-side vs server-side lag

One important nuance: resmon shows you client-side cost. Some resources look cheap on the client but hammer your database or server thread in the background. If resmon shows nothing above 0.5ms but the server still feels laggy, the bottleneck is server-side โ€” use the profiler command in your server console to catch those.

Your action plan

  1. Run resmon 1 and take a screenshot of the baseline.
  2. Sort by CPU time and note anything consistently above 1ms, especially while idle.
  3. For each offender: check if a lighter alternative exists, update it, or remove it if unused.
  4. Retest after each change so you know what actually helped.

Prevention beats cure

The best way to avoid lag is to only install well-optimized scripts in the first place. Every resource you add is a potential frame-killer, so be selective. At Viper Development, we write our scripts to sit at near-zero resmon when idle โ€” clean event handling, proper waits, no wasted frames. A good script should be invisible in resmon until someone actually uses it.

Want resources that won't wreck your frame time? Browse our optimized FiveM scripts โ†’

Premium FiveM scripts for QBCore & ESX

Viper Development builds escrow-protected, dual-framework scripts that install clean and run without dragging your server down.

Keep reading

Related guides