Game dev #15: RAM optimization
Recently, I reorganized the entire support system of the game servers as I described in this news post. The servers are now able to turn themselves off when empty, then wake back up whenever a player tries to access them. The main result is the empty ones no longer use any RAM or CPU, letting the other worlds have more resources to themselves.
The results were clear: we have had some instability for the past several weeks, including crashes every few days, and that cleared up pretty much instantly. I'm satisfied to see that it was all worth the effort!
This is something that I had been thinking about for a while and then spent most of the past month developing. The dedicated server was getting full, especially on RAM usage, causing instability. Plus, this meant that I couldn't run any more servers in parallel: bringing Seasonal and Tasmantis online for some weeks already increased the rate of issues, which is no fun for the player base, so something had to be done.
Sure, I could have opted to rent a dedicated server with higher specs, or outright get a second one, but I like to maximize what I have before getting more. Plus, this keeps the entire operation running at a lower budget, freeing money for other ventures.
Another feature that I introduced helps me keep the game servers up to date: whenever the servers wake up, they also pull the latest versions of the game itself, selected plugins and their configuration. If, say, Rodinia wakes up 10 times in a given day? That's 10 opportunities to update its files and get the latest improvements and corrections! Before, that was only possible when I did manual restarts, which could be as rare as once every few weeks.
This replaces the Python script that I mentioned back in 2017.
To summarize, this work had three main results: * An immediate, positive effect on game stability. * Easier server updates by fetching files on every wake up. * New opportunities for special projects by freeing resources.
I'm proud of the result. This required several weeks of development but will definitely pay off in the future!
– Doctacosa