Server Thread Hitch Warning in FiveM: Meaning and Fix
The FiveM server thread hitch warning means svMain started a tick over 150 ms after the last. Get the sync and network limits and find the resource behind it.
- Applies to
- FiveM Legacy FXServer on Windows and Linux (public citizenfx/fivem source as of November 17, 2026) with txAdmin v8.1.2 (October 23, 2026) and oxmysql v2.14.3 (October 6, 2026); any framework; notes for the FiveM for GTAV Enhanced Cfx Server from the official docs and the July 16, 2026 development update
- Last verified
On this page
- Direct Answer
- What “server thread hitch warning: timer interval of N milliseconds” means
- Why server scripts cause the server thread hitch warning
- Other causes: database, host and event floods
- FiveM server lag fix: find the resource behind the warning
- Sync thread hitch warning and OneSync settings
- Network thread hitch warning
- Does this apply to FiveM for GTAV Enhanced?
- Troubleshooting
- Next Steps
Direct Answer
server thread hitch warning: timer interval of N milliseconds means FXServer’s main thread, svMain, started a tick more than 150 ms after the previous one, on a timer meant to fire every 50 ms. Server scripts and queued player events run inside that tick, so one resource doing too much work delays it, as does a host short of CPU time. To fix it, run profiler record 500 in the server console while the warnings print, open the profile, find the resource with the long tick, then update, fix or remove it and recheck the svMain chart in txAdmin. The sync (100 ms) and network (150 ms) variants follow below.
What “server thread hitch warning: timer interval of N milliseconds” means
FXServer runs three timed loops, and each one measures how late it is. At the start of every tick, the server reads the clock, subtracts the start time of the previous tick and stores the new start time. When that gap is too large, it prints one of these lines. The format strings below are copied from GameServer.cpp in the public FiveM source, at the commit of November 17, 2026:
server thread hitch warning: timer interval of %d milliseconds
network thread hitch warning: timer interval of %d milliseconds
sync thread hitch warning: timer interval of %d milliseconds
%d becomes the gap in milliseconds. “Timer interval of 176 milliseconds” means 176 ms passed between the start of one main tick and the start of the next, where 50 ms was planned. The number is not the run time of one script. It is the whole gap: the previous tick’s work plus anything else that held the thread.
| Console line | Thread | Timer fires every | Printed when the gap is over | Work done in the tick |
|---|---|---|---|---|
server thread hitch warning | svMain | 50 ms (1000 / 20) | 150 ms | Server frame, queued console commands, resource ticks and queued events |
network thread hitch warning | svNetwork | 10 ms (1000 / 100) | 150 ms | Network tick, queued packet sends and packet processing |
sync thread hitch warning | svSync | About 8 ms (1000 / 120) | 100 ms | OneSync game state, only when OneSync is on |
With each line, FXServer also emits a structured trace of type hitch that carries the thread name and the time. Those names, svMain, svNetwork and svSync, are the ones txAdmin’s charts and the /perf endpoint use. The warning never names a resource: the timer only knows that it fired late, not what delayed it. Because FXServer itself prints it, the line reads the same on every server, whatever framework or game mode it runs. No Windows-only or Linux-only branch surrounds these timers in GameServer.cpp, so both platforms use the same intervals and thresholds.
Two related messages, hitch warning: frame time of %d milliseconds and hitch warning: net frame time of %d milliseconds (150 ms or more), belong to a fallback loop used only when the network layer does not support the libuv loop. The ENet layer in the same source reports that it does, so a server built from this code prints the three lines in the table.
Why server scripts cause the server thread hitch warning
The svMain tick is where server-side code runs. Following the calls in the FiveM source:
- The timer starts a server frame. The svMain timer calls
ProcessServerFrame, which runs queued console commands and ends by firing the server’sOnTickevent. - The frame ticks the resources.
ServerResources.cppconnects that event to the resource manager, which then fires its own tick events. - Queued events run in the same tick. The resource event manager hooks into that tick to, in the words of its code comment, “take queued events and trigger them”.
- Player events join that queue. Events that clients send to the server arrive as packets and are queued with a
net:source plus the player’s net ID, so their handlers also run inside the svMain tick.
The profiler shows the same structure: every frame it records opens a scope named “Resource Manager Tick”.
Every server resource’s tick therefore runs on that one thread. The Lua docs warn that a thread loop without Citizen.Wait() “can still cause the game to freeze”. On the server, a loop like that never hands svMain back, and a very long calculation or a burst of slow event handlers holds it until the work finishes, so the next timer fires late for every resource. Work can also reach the main thread between timer ticks: the SCHEDULE_RESOURCE_TICK native queues a resource’s script tick onto the main thread outside the timer.
Other causes: database, host and event floods
- Database work, as a suspect rather than a proven cause. oxmysql times every query and prints a warning when one reaches
mysql_slow_query_warning. Its docs warn that slow queries “may not indicate a database issue (e.g. server hitches)”: a hitch can make queries look slow. Read those lines together with the hitch lines, as the troubleshooting section below explains. - The host pausing the process. If the whole machine stalls, every timer fires late whatever your scripts do. On the Cfx.re forum, replies about sync thread hitch spam asked whether a VPS “might be overselling CPU time/doing ‘CPU cycle stealing’”, and another reply says the warning usually shows up when the server lacks resources, “RAM or CPU, sometimes HDD”. These are community answers, not Cfx statements.
- Event floods. A 2021 forum answer to a hitch-warning thread advised adding print statements to server events “in case someone is spamming them to lag the server, especially events involving database queries”. The owner then found “a vulnerability in my playerlist”. Queued events run on svMain, so a flood of them is svMain work. FXServer rate-limits the events each player sends: past one limit it ignores the extra events, and past a second, higher one it drops the player with “Reliable network event overflow.” Events under those limits still run, so a handler that does heavy work for every call can still be flooded.
FiveM server lag fix: find the resource behind the warning
These steps are for FiveM Legacy servers. The Enhanced differences are listed further down.
- Note when the warnings start. Write down which of the three lines appears, how often, and what was happening at the time: the player count, a scheduled job, a resource restart. A hitch tied to a moment is easier to capture.
- Look at the svMain chart in txAdmin. Open Dashboard. The card titled svMain performance shows how long ticks took over the last minute. Its dropdown switches to svSync or svNetwork, and hovering a bar shows Tick duration, Time spent and Tick count. The Server performance chart needs at least 30 minutes of runtime data; pointing at a moment on it loads that snapshot into the thread card and shows its time in the card title.
- Record a server profile while the warnings print. In the server console (the FXServer terminal, or txAdmin’s Live Console), run the commands below. 500 frames is the starting point the profiler guide suggests.
profiler statusprintsRecording: Yeswith the frames left while it runs, plus a line in the formBuffer: X events over Y frames. The console printsStopped the recordingwhen the frames run out.
profiler record 500
profiler status
- Open the profile in Chrome. Wait for that line first: while a capture runs,
profiler viewonly answersCannot view: profiler is active.Then runprofiler view. On a server it does not open Chrome by itself, so copy the link it prints into Chrome, and keep the server running while the profile loads. If the link fails, the profiler guide’s author suggests saving the profile and opening the file instead: runprofiler saveJSON hitch.json, which the guide says writes the file to the folder where yourrun.batfile lives, and wait forSave complete. Copy it to your PC, open Chrome’s developer tools, select the Performance tab, right-click the panel and choose load profile. - Find the long tick. Look for sudden spikes in the yellow CPU time graph that exceed normal frames, zoom in on one, then zoom on the yellow resource tick event beneath it. Hovering an event shows how many milliseconds that thread took, with the file and line numbers. The resmon and profiler guide walks through reading a capture in full. The profiler guide also asks for the latest server artifacts, which the artifact update guide covers.
- Confirm the suspect. On a test server or at a quiet time, run
stop <resource>and watch whether the warnings stop.ensure <resource>starts it again. - Fix, update or replace the resource. The profile shows where the time went, not how to fix it. If you maintain the code, QBCore’s Script Optimization guide, which stays online as a reference, recommends not re-creating tables or variables inside loops, controlling loop frequency with a variable
Wait(sleep), using state bags instead of “spamming TriggerEvent or TriggerServerEvent”, sending only the data you need, and timing slow sections withos.clock(). If someone else wrote the resource, send them the saved profile and the time the hitch happened.
Keep captures near the suggested size on a live server. A 2019 reply in the forum profiler thread advises against profiling a live server at all “unless you want to cause your end-users lag”, and warns that viewing a large capture, “for example 1000 frames”, will crash the server. The next reply says: “Keep it around 500 frames, and you’ll be good.”
How the txAdmin chart differs from the warning
The txAdmin chart is built from FXServer’s tickTime histograms, which the source describes as “Time spent on server ticks”. They time the work inside each tick, in buckets from 1 ms up to 250 ms. The hitch warning measures something else: the gap between the starts of two ticks. Long ticks in the chart point at code running inside the tick, which the profiler can show. Ticks that stay short while warnings keep printing mean the time was lost outside the measured tick, either on the host or in work queued onto the thread between ticks.
FXServer serves these histograms as Prometheus text on its /perf endpoint, and txAdmin reads them from there, so you can also scrape them into your own monitoring. The server-commands reference names sv_prometheusBasicAuthUser and sv_prometheusBasicAuthPassword as the basic-auth login for /perf (“Leave empty to disable”), and says both are also sent to txAdmin. Both start empty in the source, so the endpoint asks for no login until you set them.
Sync thread hitch warning and OneSync settings
sync thread hitch warning comes from svSync, which runs the OneSync game state: ServerGameState.cpp hooks into the sync tick and returns at once when OneSync is off. The timer wakes every 1000 / 120 ms, but the game state does its full update only on every third wake-up, or every sixth when sv_useAccurateSends is off. The code’s own estimate, 120 / (3 * tickMul), gives about 40 updates per second with accurate sends, the default in both the code and the docs, and 20 without. The July 16, 2026 development update agrees on 40 but gives 30 for the other case: “30 (or 40 with sv_useAccurateSends enabled)”.
Because svSync runs the game state rather than resource ticks, a sync hitch points at OneSync work. The development update also says that on Legacy, entity culling “ran on the sync thread and could only process around 16 players per tick”; on Enhanced, “Culling now runs across multiple cores inside the sync pipeline.”
A sync hitch can also come from the server build itself. In a 2021 forum report, sync thread hitch warnings on FXServer 4878 with more than 200 players were “Solved with FX Build 4973”. Rule out an old build with the artifact update guide before you change settings.
The server-commands reference lists OneSync settings and describes their trade-offs in its own words:
| Setting | Default | What the reference says |
|---|---|---|
onesync_distanceCulling | true | Removes entities beyond a certain distance and outside the view matrix from sync: “Improves performance.” |
onesync_distanceCullVehicles | false | “Can improve performance by reducing vehicle sync frequency.” |
onesync_radiusFrequency | true | “Disabling may improve performance at the cost of distant entity accuracy.” |
onesync_forceMigration | true | “Disabling may improve performance but can leave entities without an owner.” |
sv_useAccurateSends | true | “Disabling may improve performance but reduces sync accuracy.” Deprecated on Enhanced. |
These are trade-offs, not fixes. Change one at a time and compare the svSync chart before and after.
Network thread hitch warning
svNetwork wakes every 10 ms. Each tick fires the network tick event, flushes queued packet sends when sv_useAccurateSends is on, and processes the network host, a step the code comments as “process game push”. The 2021 forum thread behind the event-flood advice above shows long runs of network thread hitch warning lines while the owner’s port 30120 sent out heavy traffic during attacks, with “pings > 2000ms” for every player before they timed out. In a January 2022 follow-up, the owner wrote that Wireshark showed “extremely large LUA tables were sent several times per second”; the event name led to the player list resource, which had a vulnerability in a connect event. In that case the outgoing flood came from a resource, so check which events go out during network hitches, not only what comes in. If network hitches line up with traffic spikes from outside, the DDoS protection guide covers the network side.
Does this apply to FiveM for GTAV Enhanced?
The thresholds in this guide come from the public FiveM source, and the Enhanced server differs from it in documented ways:
- The sync rate is a setting. Enhanced adds
sv_syncTickRate, “Tick rate for the sync thread”, with a default of 60 and a range of 1 to 120; “Higher values can reduce latency but increase CPU usage.” The publicGameServer.cpphas no such setting and fixes the sync timer at1000 / 120, so the Enhanced sync thread is not timed the way that code shows. Neither the Enhanced docs page nor the development update states the warning thresholds. If you raisedsv_syncTickRateand sync problems followed, the docs’ own note applies: higher values “increase CPU usage”. - The thread names stay. The development update says the Enhanced metrics endpoint keeps “The same svMain, svNetwork, svSync thread tick time histograms as Legacy” and adds over 80 metrics, including OneSync entity counts, Lua and JavaScript memory and event loop queue depths.
- The profiler has a new backend. Enhanced replaced the legacy profiler backend with Perfetto. The update lists the commands as
profiler record <duration>andprofiler save <filename>.jsonwithout stating the unit of the duration. Traces go to theprofiler/folder inside the installation directory and open in the Perfetto UI. - txAdmin is still included. Before launch, the development update said the Enhanced Cfx Server would ship “with txAdmin still embedded”, and with the same three tick time histograms in place, the dashboard’s svMain, svSync and svNetwork charts have the data they read. The Enhanced server setup guide covers the rest of the move.
Troubleshooting
Server thread hitch warning only when many players are online
Player events are queued into the svMain tick, so busy hours put more work there. A 2019 forum report from a Linux (Debian 9) server describes hitch warnings that bring higher ping “when 50+ people on the server”. Record the profile at peak time rather than on an empty server, and, as the 2021 forum answer above suggests, look at server events that run database queries.
Hitch warnings on a fresh server with no extra resources
With almost nothing in the resource tick, look at the machine. In one forum thread, an owner saw all three warnings on a Windows Server 2022 VPS running “a base CFX server with no resources at all”, and the cause “ended up being simple windows updates”. Another owner reported the warnings only “sometimes” on an empty Windows Server 2022 test server, with nothing visible in the profiler and no in-game impact they could find with one or two players. Check for other programs using the CPU, pending operating system updates and, on a VPS, whether your CPU time is guaranteed.
The profiler shows no spike during the warnings
The profiler records frames, resource ticks and the events each resource handles. If a capture covers a burst of warnings and no frame stands out, the time was probably lost outside the work the profiler records. Check the txAdmin console for “txAdmin was frozen for”, a line txAdmin logs when its own status loop stalls for 10 seconds or more, giving examples such as “VPS Lag, DDoS”. Also check that the warnings were server thread lines: svSync and svNetwork work is not resource code.
oxmysql “took …ms to execute a query!” lines at the same time
oxmysql’s slow-query line starts with the database version, then reads <resource> took <time>ms to execute a query!, followed by the query. It prints when a query takes at least mysql_slow_query_warning milliseconds: 200 by default in oxmysql v2.14.3 (October 6, 2026), and the docs show set mysql_slow_query_warning 150 as an example. The docs add that query time “may not be entirely accurate”, that “Slow queries may not indicate a database issue (e.g. server hitches)”, and that slow queries on server startup “are not necessarily problematic”. So a slow-query line next to a hitch line does not prove the database is at fault. The 2021 forum answer above points at spammed events “involving database queries”; the profile shows whether the handler that ran the query took the time. For the slow-query convar, pool settings and query debugging, see the oxmysql connection string guide; the MariaDB database setup guide covers the database server itself.
txAdmin says “Server is not responding” and restarts the server
txAdmin’s monitor resource sends its heartbeats from two Lua threads that wait 3000 ms between beats, so they depend on the same server thread as your scripts. In txAdmin v8.1.2, a heartbeat gap of 10 seconds or more counts as delayed, and txAdmin’s console warns Server is not responding. with a note that it stopped receiving heartbeats. After 60 seconds without one, it logs Restarting server: Server is not responding and restarts the server. Heartbeats missing for that long mean the server thread was stuck, not just slow. Read the console lines just before the restart, then profile the server once it is back up.
resmon looks clean but the console keeps warning
resmon is a client console command: the docs list it among the developer commands of the game client, where it monitors CPU and memory use per resource. The docs say it “Comes in handy when you encounter performance issues during gameplay.” One forum poster with repeated server thread warnings noted that “resmon” did not show any problems. For server-side time, use the server profiler, which the profiler guide names for finding hitch warnings. Streaming problems such as the oversized assets warning have their own guide.
Next Steps
- Learn to read profiler captures and resmon in the resmon and profiler guide.
- Rule out the database with the MariaDB database setup guide and the oxmysql connection string guide.
- Keep the server on current artifacts with the artifact update guide, since the profiler guide asks for the latest server artifacts.
Browse FiveCrate assets
Original FiveM assets made in-house, with free updates and a multi-server license.
Official documentation and repository references
- citizenfx/fivem: GameServer.cpp (hitch warnings and thread timers)
- citizenfx/fivem: ServerResources.cpp (resource tick on the server thread)
- Cfx.re Docs: Using the Profiler
- Cfx.re Docs: Server Commands
- Cfx.re Docs: What's Changed in FiveM for GTAV Enhanced
- Cfx.re Forum: Development Update #3, FiveM for GTAV Enhanced
- txAdmin v8.1.2: ThreadPerfCard.tsx (dashboard thread chart)
- Overextended Docs: oxmysql
Related guides
FiveM Database Setup: MariaDB and HeidiSQL Guide
FiveM database setup step by step: install MariaDB instead of XAMPP, create a database and an account, connect HeidiSQL and oxmysql, then import SQL files.
oxmysql Setup: mysql_connection_string Explained
Set mysql_connection_string for oxmysql 2.14.3: both formats, password characters, set vs setr, pool options, slow query warnings, debug convars and fixes.
FiveM resmon and Profiler: Find the Resource Causing Lag
How to use FiveM resmon and the profiler: fix Access denied for command resmon, read every resmon column, record a server profile and open it in Chrome.
FiveM 'Oversized Assets' Warning Explained and Fixed
The FiveM oversized assets warning starts above 16 MiB of physical or virtual memory. See the real FXServer thresholds and how to shrink a YTD file.
How to Update FiveM Server Artifacts and Fix EOL Errors
Update FiveM server artifacts on Windows or Linux without losing txData: pick Recommended or Latest, then fix end-of-life, outdated and native errors.


