Server lags/freezes briefly when a player leaves

When a player leaves the game, and sometimes when a player joins, all the clients freeze briefly for 0.5 - 2 seconds. This can become a real problem for large servers where players are constantly joining and leaving.

To solve the issue, I had a go at using the Microprofiler. I believe the section highlighted in red is the problem:

I don’t have a lot of experience using the Microprofiler, so I was wondering if anyone could help explain what this means and what may be causing it. Thanks.

1 Like

What it seems like is a script is preforming some sort of task when a player is leaving and joining try checking all your scripts and see if it those are causing this

1 Like

Look throughout all your scripts for PlayerAdded and PlayerRemoving events and see if you can refine them. They might be doing alot of stuff everytime they leave(for instance removing 1000s of parts without using a wait() )

1 Like

@Venetrix @Sebastian_Wilson I’ve started sifting through them. Do you know what ‘perform’ and ‘present’ mean, and if there’s any easy way to specifically find the problem?

Preform is usually when a script is ran, So this is a script problem also if you click on them it gives you a graph that shows how much activity is going on with such thing.

Turns out I’d been a bit of an idiot - 30 billboard GUIs were being cloned to player every time another player joined or left the game. It was instead meant to only do this after the individual had died and lost their billboards.

@Sebastian_Wilson @Venetrix I appreciate your advice, cheers

Perform isn’t scripts running – it’s rendering. In this case, BillboardGUIs being drawn.

1 Like

Ok thanks