‘timerServiceOnHeartbeat’ causing lag spikes (freeze)

We have lag spikes (game freezes) that as the session progresses, they are more likely to happen, they happen each 1-5 minutes and can keep from 0.2 seconds up to 5 seconds. sometimes they are just stutters and if you keep long enough they can become seconds long.

This have been happening for a few months, what we could track until now:

  • Only happens on computers
  • When you teleport to an empty area (map totally streamed out), it is as intense as if you were surrounded by instances/players
  • The better the device, the more likely it is to happen
  • The more players in the server, it is more likely to happen
  • seems to only happen with streaming mode set to Opportunistic

Our game, where the lag freezes happen:

Reproduction: just stand still and wait up to 10 minutes on a full server, where you are doesn’t matter

This is the same issue that happened on these closed topics:

Microprofiler:
MicroProfiler_Lag.html (8.6 MB)
Screenshot

3 Likes

Hello, I played the game mentioned naturally and I had the lag spike, I don’t know why and how it happens.

2 Likes

thank you very much for helping confirm our bug. Hopefully Roblox staff get back to us as we made a ticket. It’s been a persistent bug since December. We have exhausted all efforts in locating a potential cause on our end.

2 Likes

Hello, we are looking into this for you.

:eyes:

3 Likes

Are you using any sort of parallelism. I’m seeing something like … 60k threads+ stalling in the heartbeat tick here.

1 Like

It seems to be fixed! thanks alot for the help.

For those who wonder:

A heartbeat was searching all players.
When players aren’t loaded, a waitForChild set to 60 seconds would wait,.
20 unloaded players x 60 seconds each = 20 minutes until that beat dies.

the wait for childs would stack up to time making it +60k

3 Likes