October was a busy month. We had a lot of new players join, and we did what we could to optimize the server hosted on Google Cloud to keep up with the demand. Despite some of the changes, we still reached almost $150 in charges for the month. Thankfully we are still running on free credits, although they are quickly running out:
Looking at the cost over the month, you can see a bump in the usage cost around October 20. This is where I changed the server from an n1-standard-2 (2 vCPUs, 7.5 GB RAM) to a n1-highcpu-4 (4 vCPUs, 3.6 GB memory). This was because we were running at 100% CPU usage very frequently to the point where the Minecraft server was reporting we were missing server ticks. This was likely due to plugins like DynMap, but also having 5-10 players on the server frequently. I was able to reduce the RAM usage, as we were never going above 4GB RAM, and this seemed to work well.
You can see from the usage breakdown, that the majority of cost was CPU and RAM running, along with SSD storage. I had switched from the Premium Network Tier to Standard Network Tier to try and reduce network usage costs, and this probably reduced network traffic a bit, but you can see we still used around 90GB of network egress.
I worked with Google Cloud Support to try and adjust settings so backups wouldn’t get counted in the network egress. According to them, they should not, but we had to do numerous things to enable Private Google Access on the server, so the backups could go over an internal network path instead of the internet. I’m not convinced this really changed anything, as we still used quite a lot of network traffic, and their own documentation states that Private Google Access doesn’t work when the server has a public IP address.
The dip at October 29th is when I shut the Minecraft server off. Even after all of my adjustments, and working with Google Cloud Support, the server is still costing too much to keep running on Google Cloud. As I’ve purchased and set up an onsite server, I have moved the Minecraft server network over to it.
From discussions online, the two major things that would have helped with reducing server costs would be using a Preemptible Virtual Machine, and shutting the server down when it isn’t in use. For the first part, I wanted to keep the server highly available, and I didn’t like the idea of leaving it open to be shut down with short notice when something else on Google Cloud needed priority. For the second part, I started working on a script to shut the server down at night when there are no users on it, but it may not be necessary on my own server.
I still plan on keeping this website running on a Google Cloud f1-micro (1 vCPU, 0.6 GB memory) instance, which should be close to free. I will be doing more experimentation with Google Cloud, but not for running Minecraft.