# Fixing server thread hitch warnings

> Understand the FiveM server thread hitch warning: what the timer means, when hitches are harmless and how to find the cause with the profiler.

Source: https://fam-tools.com/guides/fivem-server-thread-hitch-warning · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 10 min

**Short answer.** A hitch warning means the server thread was blocked for the number of milliseconds shown. Ignore hitches during startup and resource restarts. If they happen during play, record the profiler while they occur (`profiler record`, `profiler view`) to find the resource, look for synchronous work (heavy loops, blocking queries, large file I/O, big JSON encodes), and check the host for CPU steal or overload.

## Key points

- The number is how long the thread was blocked.
- Startup and `restart` hitches are normal.
- Regular hitches in play = a resource or the host.
- Profile during the hitch — guessing wastes days.
- Move heavy work off the tick: spread loops, use async queries, cache.

“server thread hitch warning: timer interval of 312 milliseconds” is one of the most common lines in a FiveM console. It means one server tick took far longer than it should, and players feel it as rubber-banding, delayed doors and late damage. A few at startup are normal; a steady stream during play is a problem with a findable cause.

## What the warning means

The server runs its game logic in ticks. When a tick takes much longer than the normal interval, FXServer prints a hitch warning with the actual interval. Similar warnings exist for other threads (network, sync). Players cannot be updated while the thread is blocked, so movement and events arrive late.

| Situation | Worry? |
| --- | --- |
| During server start or `restart <resource>` | No — loading is expected to block |
| Once after a large database migration | No |
| Every few minutes at peak time | Yes — profile it |
| Constantly, even with few players | Yes — likely a script or the host |

## Find the cause with the profiler

*Server console*

```cfg
profiler record 500
# wait for it to finish (or reproduce the hitch)
profiler view
```

The profiler records a number of frames and opens a timeline showing which resource and function consumed each tick. Look for the long frames and what ran inside them. Full walkthrough: [the profiler guide](https://pityus.net/guides/fivem-profiler-guide).

## Common causes

| Cause | Fix |
| --- | --- |
| Loops over all players/vehicles every tick | Run them every few seconds and spread work over ticks |
| Huge `json.encode` of player data on save | Save only changes; stagger saves |
| Synchronous file I/O (`SaveResourceFile` in loops) | Batch writes, use the database |
| Slow queries (missing indexes) | Add indexes — see [database design](https://pityus.net/guides/fivem-database-design) |
| Mass entity spawning at once | Spawn in batches with small waits |
| Overloaded or noisy VPS | Check CPU steal/usage; upgrade — see [hardware](/guides/fivem-server-requirements-hardware) |

## Is it the host?

If the profiler shows no single heavy resource but hitches persist, look at the machine: on Linux run `top` and watch the `st` (steal) value — high steal means other customers on the same host take your CPU. The database competing for CPU, backups running at peak time and antivirus scans on Windows cause the same pattern.

## A fix plan

1. Note when hitches occur (time, player count, what was happening).
2. Record the profiler during that moment.
3. Fix or replace the resource responsible; retest.
4. If nothing stands out, check host CPU and move heavy jobs (backups) off peak.
5. Keep an eye on resmon during play — see [server performance](https://fam-tools.com/guides/fivem-server-performance).

## Questions

### What does server thread hitch warning mean?

A server tick was blocked for the number of milliseconds shown, delaying updates for every player.

### Are hitch warnings at startup a problem?

No. Loading resources blocks the thread; hitches during start and resource restarts are normal.

### How do I find which script causes hitches?

Run `profiler record` while the hitches happen and inspect the result with `profiler view`.

### Can bad hosting cause hitch warnings?

Yes — CPU steal on oversold VPS hosts or an overloaded machine causes hitches even with good scripts.

## Related

- https://fam-tools.com/guides/fivem-server-performance
- https://fam-tools.com/guides/fivem-server-requirements-hardware
- https://fam-tools.com/guides/fivem-too-many-resources
- https://fam-tools.com/guides/fivem-entity-limits-cleanup
