Finding Causes For Lag?

Hey there,

I just put my game,
https://www.roblox.com/games/6079125551/Super-Speed-Race-Simulator-Beta
in beta, I got like 1.3k visits from it from two days ago and yesterday.

With all those people, servers got REALLY laggy.

So I would like to know if there is a way to find the source of that lag, whether it is too many parts, or scripts(that is most likely).

Is there a way I can find the exact script that is causing the most memory issues and what not? Possibly using the performance stats?

Actually it is the dev console, not the performance stats

Do you mean FPS lag or server lag? For FPS lag, I suggest adding low graphics settings and removing unneccesary parts. As for server lags, if you have a lot of scripts running at the same time, that might be the cause.

1 Like

MicroProfiler can help. Also depends on what type of lag it is. Script lag or framerate lag. If it’s framerate lag (FPS lag) I can try to help.

1 Like

I am thinking it might be scripts because I have a lot, do you know if there is a way to pinpoint the exact script that would potentially be causing the most issues?

As far as I can tell this is what happens: (I am not very familiar with all the stats and different things in the dev console) the server start with about 500 on the client memory for computers, I think around 600-700 for mobile. Everything will be ok if there are a couple people in the server, but once a bunch of people start joining and leaving, everything slows down, a five second timer taking 20 seconds, pets that are supposed to constantly tween behind a player take like 1 seconds between each point they are supposed to be at when it should be taking 0.000something really small, GUIs timing like for when they pop up and leave are all wonky and messed up, players earn speed at an extremely slow rate because it takes 30 to earn what it should take 1. So yeah I don’t know it is almost like with every player joining and leaving the lag builds up.

This is script performance lag. I suggest putting your code in Code Review and asking people for help if you can’t find the problem in your scripts. Most likely a memory leak in your PlayerAdded function.

1 Like

Ok thanks, besides player joining, is there anything I should specifically look for to show? Loops? Local stuff? Server stuff?

For memory leaks, look for when you create certain things but never destroy them. Look for things that infinitely loop accidentally, functions that possibly create things but never delete them, etc.