Engine & DB Tuning
FiveM resmon Script Profiling & 0.05 ms Idle Tick Discipline
Identify rogue Lua and Node.js V8 scripts in resmon before scaling past 200 resources and 256 concurrent OneSync players.
<= 0.05 ms Idle Script · Zero Wait(0) Polling · State Bags
Compound Cost Across 300 Resources
A single script idling at 0.15 ms looks harmless in isolation. Multiply 0.15 ms across 180 poorly written scripts and you consume 27 ms of tick budget before a single player pulls a trigger.
Replacing Distance Loops with State Bags
Convert continuous GetEntityCoords distance checks into OneSync state bags and ox_target interaction zones so idle CPU drops near 0.00 ms.
Measured Thresholds & Server Configuration
| resmon Reading | Classification | Action Required |
|---|---|---|
| 0.00 - 0.03 ms idle | Healthy event-driven script | Keep as-is |
| 0.08 - 0.25 ms idle | Moderate polling loop | Increase Wait() or use ox_lib zones |
| > 0.50 ms idle | Severe hitch & FPS killer | Refactor or remove immediately |