한국어English日本語简体中文繁體中文DeutschไทยTiếng ViệtРусскийPortuguês (Brasil)EspañolBahasa Indonesia

Game Lag White Paper › L9 Server game process

Blocking calls on the game thread Synchronous DB / file I/O on the game loop

Cause ID sp-sync-call · Primary owner Game team (Server development)

Open the interactive card with figures and simulations →

If the server waits for a DB response or a file write in the middle of a tick, all game progress on the server stops for that long.

Why The tick waits on DB reads and writes, log writes, or external API calls → Effect If the DB takes 100 ms, the tick stalls for 100 ms too → On screen Every time the DB or disk slows down, the whole field hitches

Symptoms
Freeze, Stutter
Factors
Stall
Who’s affected
Specific zone/channel, Whole server
When
During specific actions, Randomly
Owner
Primary owner Game team (Server development)
Game team action items
Hand all slow work (DB reads and writes, log writes, external API calls) off to run asynchronously and apply the results on the next tick (a timeout alone still leaves the tick stalled while it waits).
Ballpark numbers
Even a 0.5 ms DB round trip within the same data center adds up to 50 ms if it’s called 100 times in one tick. That alone uses up the entire 20-tick budget.
On the graph
Random spikes · Server tick time, DB query latency
Where to look
The tick time graph on the same time axis as DB query latency (slow query log and so on) and disk latency. Without tick metrics, bcc offcputime -p to see where the game thread waits
Confirmed if
Tick spikes coincide with DB or file latency spikes, and the game thread’s wait time is concentrated in call stacks that receive DB responses or write files
Ruled out if
DB and disk latency quiet while ticks spike: points to a GC pause or lock contention
Check with
Game server or client logs and metrics

Sources

  1. Designs, Lessons and Advice from Building Large Distributed Systems Google
    LADIS 2009 keynote (Jeff Dean). Round trip within the same data center about 0.5 ms (500,000 ns)
  2. ASP.NET Core Best Practices Microsoft
    Call data access, I/O, and long-running work asynchronously; synchronous blocking calls lead to thread pool exhaustion and slow responses
  3. Demonstrations of offcputime, the Linux eBPF/bcc version IO Visor
    Sums the time threads spent blocked off the CPU (off-CPU) per call stack; -p selects the process

See also

Same layer: L9 Server game process

Same symptom (Freeze), other layers

View the interactive card with figures and simulations