Hi ya’ll, I am a developer for a game called Car Parking Level 7, and we experience severs randomly crashing. From what I know, they cannot last one full day. BindToClose does not run, which indicates the server crashed.
I have experienced it live multiple times, and all players get kicked with Please check your internet connection and try again.
There’s always at least like 34+ players within the server as it crashes. The crash time is always identical. Server lasts for about 3-4 hours.
If this helps, 5 scripts are connected to runservice’s heartbeat, and one main script for real time lighting. I have attempted to optimize server-side code multiple times with no real success.
I am also experiencing the same issue where servers that used to function exceedingly and are stable when faced with lots of players constantly joining at the same time or inserting large models. It doesn’t look like an error with the game’s code optimization, but more likely with Roblox’s servers that are not correctly optimized on niche-based games. This issue happened last week, and multiple large communities I am aware of are experiencing the same problem with servers crashing for no reason.
It’s a tough one because 2 things will take down a Roblox server in time, memory usage and CPU usage. In my opinion, the CPU usage is tougher to get a handle on. I haven’t found any script calls in my research that let you check how much CPU your server is using as a whole. I know you can look at the dev console and watch that real-time, but it doesn’t help with any automation to help control it. I know from testing that a certain amount of CPU usage will trigger a watchdog and close the server. Mainly either to prevent runaway CPU usage or people using the servers to do something that isn’t allowed, like mine cryptocurrency for example.
The best you can do is create your own CPU tracker (or memory tracker if you feel that is more the issue) and have your server auto-throttle when it starts to red-line. That was the solution for my game because it would peg out the server CPU sometimes with a lot of players going crazy and the Ai trying to keep up. It would bring the game to a crawl for everyone otherwise without the auto-throttle I setup.
I think the classic “Script timeout: exhausted allowed execution time” is supposed to prevent this from happening. A program won’t crash because it’s using 99% of your CPU, but it will crash if it uses up all of your memory. That’s because, high CPU usage will simply mean tasks will take longer from other processes, but no usable memory is immediately a fail state as the program literally can’t do anything.
And yeah, you can probably also check the post I linked as it has a “maybeWait” example that only yields if the script thinks it’s been blocking the engine for too long.
Back to the problem at hand for this post, have you tried looking at old servers’ memory usage? Memory leaks are usually the cause for these types of situations, where old servers crash for seemingly no reason.
I also personally think Roblox could to more to indicate that servers are crashing due to out-of-memory errors, it could speed up fixing these issues massively.
For one script, I agree. But for thousands or millions of scripts that would never hit this limit, the little things add up. I agree, memory should be checked first, but if memory isn’t an issue, CPU management is the next step. There is a CPU limit, it’s about the same as a single 3.2 GHz processor in my testing, though the threading and such kind of muddies exactly how the Roblox server engine handles really high CPU loads. I’ve always been about to blow up the server engine with CPU before I got close to the 4GB limit on memory.