Random 40 to 100 ms server stalls on live servers that we can't trace to our code (Server Authority)

Hi! We make MageBrawl, a fast PvP arena game on Server Authority (RunService:BindToSimulation, 60 Hz, place ID 84169602023740). We’ve been chasing server lag for a long time and have fixed everything our own profiling could find. What’s left looks like the server itself pausing. We’d like help working out what it is and whether we can do anything about it.

This is critical for us because MageBrawl is a competitive game. In competitive games like League of Legends or Valorant, a server hitch in the middle of a fight would never be acceptable, and our players feel it the same way. We need the server to hold a steady 60 Hz during fights (example gameplay below).

What we see

On live match servers, a server frame sometimes takes 40 to 100 ms instead of about 17 ms (median 46 ms). 26 of our last 35 multiplayer matches had at least one frame of 37 ms or more. In fights it shows up as a brief hitch.

How we measure

Every server records a sample every 2 seconds and sends the slowest ones to our own archive. Each sample has:

  • the longest gap between two Heartbeats
  • the time from PreSimulation to PostSimulation
  • os.clock() laps inside our BindToSimulation callback, split per player and per phase (input, combat, movement)
  • the Lua heap (collectgarbage("count")), plus a canary in a weak table that tells us when Luau runs its atomic GC step
  • the abilities cast in the window, and each client’s frame time and network timing

Where the time goes

Of 86 frames with a Heartbeat gap of 37 ms or more (Oct 23 and 24, place versions 7107 to 7163):

Where the extra time was Frames
Inside our BindToSimulation callback 44
Between PreSimulation and PostSimulation, but outside our callback 3
Outside PreSimulation to PostSimulation entirely 39

Why we don’t think it’s our code

  • Our callback costs a median of 1.1 ms per step. The stalls land in whichever player’s step happens to be running, in any phase, whatever character they play. In most of them, that player wasn’t casting anything.
  • It isn’t garbage collection. The canary caught atomic steps inside our callback only 4 times in 3,037 windows (142 times between steps), and in none of the 51 slow steps. The Lua heap is only 50 to 80 MB.
  • It isn’t the player’s client or connection. During the slow steps, the stepped player’s frame times and ping were normal.
  • It isn’t our HTTP reporting. Uploads line up with only 2 of the 39 stalls outside the simulation span.
  • It also happens on solo practice servers that have been up for half an hour with one player. One had a 78 ms Heartbeat gap while our callback took 1.6 ms.
  • The same measurements did find our own problems, and we fixed them:
    • hit tests on a map full of chains (up to 44 ms per step, now about 1.5 ms)
    • a freeze of about 2 seconds while match servers loaded scripts (now 0.2 s)
    • scans of the whole workspace

Examples

Each window covers the 2 seconds before the time shown.

JobId Time (UTC) Heartbeat gap Our callback PreSimulation to PostSimulation Players
e0512312-1cc6-4107-bbd8-ab7ffc7b2856 Oct 23, 21:38:30 98 ms 78 ms 82 ms 2
b3d82e50-bf5a-47ba-8f1a-f3600f694953 Oct 24, 21:31:26 85 ms 63 ms 65 ms 6
97721732-ebea-4df7-96a1-1c3fa8844059 Oct 23, 21:46:21 75 ms 17 ms 59 ms 2
10f8409b-f11a-4d08-9bd6-5e4f3732a557 Oct 23, 20:49:50 89 ms 31 ms 47 ms 4
e1092c2e-f55d-4a9e-a0b8-5f453414dd81 Oct 24, 10:51:11 78 ms 1.6 ms 1.9 ms 1

Server memory is about 1 GB, with about 284k instances. Most of those are old map backups in ServerStorage that the game never touches. We can remove them if that could matter.

Questions

  1. Is this a known issue on live servers, for example host load or another engine job pausing the server?
  2. Can engine work run inside a BindToSimulation callback and show up as time in our Lua? For example rollback or snapshot bookkeeping, replication, or spatial query updates.
  3. Is there a way to see what a live reserved server was doing during one of these frames? The server MicroProfiler is manual, and these stalls are sporadic.
  4. Is there anything we can change on our side to avoid or hide them?

Happy to share full window dumps or our measurement code. Thanks!

5 Likes

Hi gigabite176, thank you for all the effort you’ve gone through to help measure the performance issue.

The custom timing data is useful.
Could you capture a server MicroProfiler dump during one of the 40–100 ms stalls?

  1. Join the live place (IE not Studio) with edit permissions.
  2. Open Developer Console with Ctrl+F9 on windows / ⌘F9 on Mac
  3. Select MicroProfiler → Server.
  4. Set the capture to 60 frames with 0 seconds of delay, and click Begin server recording. If possible, reproduce the hitch while recording.
  5. Please send us the dump together with the UTC timestamp, JobId, player count, and place version. This might help us to look for the engine job breakdown outside the BindToSimulation callback.

Thank you for your help in isolating this issue.

1 Like

Hi, thank you for looking into this. I captured two live server MicroProfiler dumps during the stalls using our F8 recorder with LibMP. Each contains 60 complete frames.

Capture details:

UTC: October 27, 2026 at 00:04:22.776 and 00:05:07.776
Recorded server heartbeat gaps: 40.64 ms and 75.36 ms
JobId: 60bc46a6-4871-4ddb-a323-19a98b6547a7
Place ID: 84169602023740
Place version: 7279
Player count: 2

The ZIP contains both dumps and their metadata.

In that same server, we also recorded a 1.85 second probe reply delay and a 1.74 second gap in our custom position messages. The client continued rendering during this interval, and the measured server probe handler took 0.036 ms. This happened before the first server dump was transferred.

The server stalls and attached dumps are the main focus of this reply. As a separate side note, after switching servers during the recording, I experienced persistent jagged movement again, like the issue in my older report.

That lasted through roughly two minutes of recorded gameplay. Median render frame time was 5.99 ms, while reported local physics FPS stayed at 52 to 53, compared with 60 in the earlier server. Our custom position messages continued at about 60 per second.

The later JobId was b493a34b-2309-486f-ad7b-dc857b0f464f, also version 7279. We did not capture a server dump from that job; the attached server dumps are from the earlier stalls.

This is critical for us because MageBrawl is a competitive 5v5 game, and players need consistent movement and responsiveness during fights. We have not yet been able to identify the cause of the server stalls and would really appreciate your help. Thank you.

MageBrawl-Latest-Server-Profiles-2026-10-26.zip (2.5 MB)

1 Like

Thank you, these are very helpful

1 Like

Thank you so much for looking into this! Please let me know if you need more logs or any additional testing. I’m happy to spend unlimited time and effort for this, as it is critical for our game!

1 Like

Are you able to upload the actual Microprofile dumps that usually come in .html format? That would be much more helpful for inspection.