FixesFiveM

FiveM Server Thread Hitch Warning and Lag Fix (2026)

What "server thread hitch warning" means in FiveM, how to find the laggy resource with the profiler and resmon, and the fixes that actually work.

Updated Oct 1, 2026 · 7 min read

On this page

server thread hitch warning: timer interval of 412 milliseconds means FXServer's main thread was stuck for that long: for 412 ms no scripts ran, no events fired and every player waited. A few hitches while the server starts are normal. Hitches during play almost always come from one resource doing too much work at once, usually a big database query, a loop over every player or vehicle, or a save that runs on a timer. Find it with profiler record on the server and resmon on a client, then fix or replace that resource.

What the hitch warnings mean

FXServer runs several threads, and each one warns when it falls behind:

Warning Thread Usual cause
server thread hitch warning Main script thread A resource blocking: heavy loops, slow synchronous database calls, big file reads
sync thread hitch warning OneSync entity sync Too many entities (vehicles, peds, props), entity spam, a burst of players joining
network thread hitch warning Network traffic Network spikes, overloaded host, very large event payloads

The number is how long the gap was. Under about 100 ms now and then, players will not notice. Several hundred milliseconds, or warnings every few seconds, means rubber banding, delayed inventories and doors that take a second to open.

When a hitch is longer than a few seconds, players start timing out.

Is it the server or my PC?

Check before you change anything:

  • Only one player lags, everyone else is fine: that player's PC or connection. Have them press F8 and run cl_drawfps true to check their FPS.
  • Everyone lags at the same moment, and the console shows hitch warnings: the server.
  • Everyone has low FPS but no hitch warnings: client side scripts (often a HUD, a target script or a map) eating frame time. Use resmon, below.

Step 1: Look at the txAdmin dashboard

The txAdmin Dashboard shows a chart of the server thread's performance over time, next to CPU and RAM use. Look for:

  • Regular spikes, for example every 5 or 10 minutes. That is a timer: a save loop, a cleanup, a payday or a scheduled database job.
  • Spikes when players join. Character loading or multicharacter queries that are too heavy.
  • Steady slowness that grows over hours. A memory or entity leak that a scheduled restart hides. Fix the leak, but also make sure you restart every 6 to 12 hours under Settings > FXServer > Restart Schedule.
  • RAM near your plan's limit. If memory is full, nothing else on this page will help much. See the RAM section below.

Step 2: Profile the server to find the resource

FXServer has a built in profiler. In txAdmin's Live Console (or the panel console on Plain FXServer):

profiler record 500

That records the next 500 server frames. Wait until it finishes (profiler status shows progress), ideally while the lag is happening, then:

profiler saveJSON hitch.json

Download hitch.json from the server folder with the Files tab or SFTP and open it in Chrome DevTools' Performance tab (load the file). The wide blocks are the slow ones, and each is labelled with the resource that ran it. Full details are in the FiveM profiler docs.

Step 3: Check client side scripts with resmon

resmon shows how much CPU time and memory each resource uses on your own client. Press F8 in game and type:

resmon 1

If you get "Access denied for command resmon", you need FiveM's developer mode: switch FiveM to the Beta or Latest update channel in FiveM's settings, or launch it with +set moo 31337. See the FiveM client console docs.

How to read it:

CPU msec per resource Meaning
0.00 to 0.05 Well written
0.1 to 0.3 Fine for something like a HUD or target script
Above 0.5 at idle Suspicious. Something loops every frame for no reason.
Above 1.0 That resource is costing your players FPS

At 60 FPS a frame lasts about 16.6 ms in total, and GTA V itself needs most of it. Twenty resources at 0.5 ms each is 10 ms of lost frame time.

The usual suspects

These cause most FiveM lag problems:

  1. Database calls that block. Old scripts using MySQL.Sync or mysql-async, or queries without indexes on big tables. oxmysql warns about slow queries in the console, by default anything over 150 ms (set mysql_slow_query_warning 150). Every warning there names the resource.
  2. Save loops. Scripts that save every player, vehicle or stash on a timer, all in one go. Spread the work out or save on change instead.
  3. Loops over every entity. Scripts that scan all vehicles or peds every second on the server.
  4. Too many entities. Vehicle spawners that never delete cars, props left behind by jobs, population that is too dense. This shows up as sync thread hitches.
  5. Duplicate systems. Two inventories, two target scripts, two weather syncs. It happens a lot after following several tutorials.
  6. Outdated framework resources. An old qb- or esx_ resource from a years old download. Update to the current version from the official repo.
  7. Huge streamed assets. Not server CPU, but oversized car and map textures cause "texture loss" and stutter on clients. See adding cars without wrecking performance.

The fastest test is to stop the suspect: stop resourcename in Live Console, wait for the time the lag usually happens, and watch the console. If the warnings stop, you found it.

Is OneSync causing lag?

OneSync is FiveM's server side entity sync, and almost every modern script expects it. Leave it On (set onesync on, or the OneSync setting in txAdmin's FXServer settings). txAdmin's own settings say the other modes are deprecated. OneSync is not the problem; what you sync through it is. Lots of networked props, peds and vehicles are what turn into sync thread hitches, so clean up entities rather than turning OneSync off.

How much RAM does a FiveM server need?

RAM rarely causes hitch warnings by itself, but a server that runs out of memory starts swapping or crashing, which looks like lag first.

Server RAM
Vanilla freeroam or a small test server 4 GB
QBCore, Qbox or ESX roleplay, up to 32 players 8 GB
Roleplay with many custom cars, maps and scripts 12 GB
Busy 48 slot server with a large resource pack 16 GB

FiveM does most of its work on one thread, so a fast CPU core matters more than many cores. Doubling RAM will not fix a script that blocks the main thread for 400 ms. It only helps when memory is actually full.

Checklist when the server lags

  1. Read the console. Hitch warnings, oxmysql slow query warnings and script errors usually name the culprit.
  2. Check the txAdmin dashboard for a pattern (timed, on join, growing).
  3. profiler record 500 during the lag, then look at the widest blocks.
  4. resmon 1 on a client for FPS problems.
  5. Stop the suspect resource and see if the lag goes.
  6. Update or replace it. Remove duplicates.
  7. Set restarts every 6 to 12 hours.
  8. If RAM is at the limit after all that, move up a plan.

On GamezServers

txAdmin's dashboard shows CPU and RAM use, and you can upgrade or downgrade from Settings any time with the price prorated, so moving from 8 GB to 12 GB for a bigger car pack takes a minute and a restart. Before pulling resources out to test, press Backup so you can put everything back. Our general game server lag guide covers network side causes too, and FiveM hosting has the plan sizes.

FAQ

Are hitch warnings at startup a problem?

No. While the server starts, resources load files, connect to the database and create tables, and hitch warnings during that minute are normal. Only worry about hitches once players are on.

Why does my FiveM server lag every few minutes?

A regular rhythm almost always means a timer in a script: an autosave, a payday, a cleanup or a weather sync. Profile during the spike and look for the resource whose block lines up with it.

Will a better CPU fix hitch warnings?

A faster core shortens every hitch, but a script that blocks for 500 ms on one host blocks for 350 ms on a faster one. Fixing the script is the real fix.

Does player count cause hitches?

More players means more entities and more events, so badly written scripts get worse as the server fills. A clean server handles 48 players without hitching.

Can txAdmin restart the server automatically when it freezes?

Yes. txAdmin restarts FXServer if it crashes or stops responding, and scheduled restarts in Settings > FXServer keep memory leaks from building up.

Skip the setup. Your own FiveM server.

$4.99USD first month

Then $9.99/mo. Just trying it? $2.50 for 3 days

Keep reading