Balance, Polish and stress testing the server!


This week, I learned what happened when I launch 120 copies of the Godot client on my computer simultaneously!

Its not pretty.  They all took up ~300 megs and started thrashing my computer!  Sadly, though I could technically control my computer the thrashing led me to shut it down.

---------------------------------

The goal was to stress test the small VM Superspace currently runs on.  Up until now the most I had played the game with was somewhere around 4v4 with some friends in the Tiny Mass Games group, but I wanted to make sure that I could scale to a reasonable number without scrambling and grabbing additional hardware.

For my second attempt I set max total players down to 60 -- 10 per server with 6 servers being spawned, and replaced the command I had been using with the following command which launched my godot app without any visual or audio elements:

start superspace.exe --no-window --display-driver headless --audio-driver Dummy autoplay
Note, I don't think --no-window actually does anything.  It is what was suggested for Windows but I found it had no effect, so I suspect it is a Godot 3 command.  --display-driver headless --audio-driver Dummy both seemed to work, causing the ram usage to be about a third what it was previously.  With this, spinning up 60 people on my local computer was no sweat -- and then I force disconnected one to jump onto a server myself and confirm that the lag wasn't atrocious.  running Top on my linux box gave me hope that I was only using 60-80% of CPU and even less Ram.

The automated ships also represented a worst case -- playing ships that continually fired bullets that the server needed to sim and check collision against, and constantly using analog input with different values so that would need to be resent every tick.

The results at 60 were sufficient for a fun playable experience though there were a few slight lag spikes.  Again, since this is a worst case I think this is good enough for my purposes!  It also gave me more confidence that my Matchmaker worked!  I had tested it a bit by limiting severs to 2 players per and spinning up 4 of them, but this represented a much more realistic use-case and it worked like a charm!  The matchmaker even quickly reclaimed the open spot for the user I force closed, and correctly sent a all servers full message to the client when there were no spots open.



Files

index.zip Play in browser
Sep 21, 2023

Get SuperSpace

Leave a comment

Log in with itch.io to leave a comment.