by ptrik on 9/8/21, 9:40 AM with 219 comments
by stjo on 9/8/21, 1:40 PM
It’s so cheap[1] to start and stop servers on demand that I’ve decided to give “away” servers for free. I wrote a little proxy in Go that detects minecraft login requests and starts a server with the specific world. After a dropped connection I stop it.
[1] For 15€/month you can have ~30 servers running in parallel and thousands of powered down worlds. https://contabo.com/en/vps/
by angulardragon03 on 9/8/21, 11:08 AM
by 015a on 9/8/21, 1:31 PM
I had never heard of this architecture before; a pretty creative way of doing Heroku-like scale-to-zero at nearly no cost on AWS.
> Fargate launches two containers, Minecraft and a watchdog
I'd love to see a cost analysis between running the "watchdog" as a Fargate container versus another lambda function. Even having a lambda function run once every 5 minutes 24/7 would trigger ~15,000 invocations a month, which is in the realm of "near Free".
If there was some way to trigger the scale-down event from there, it would reduce the expensive part of this setup (Fargate) even further. Though, granted; given both containers are packed into the same Fargate VM, it would really only mean freeing up some additional resources for the Minecraft server.
It looks like the watchdog is simply checking for connections on a port, which is probably too low-level to handle with lambda. But, an architecture like this could work in a ton of services, and if you had e.g. an ALB set up in front of the services, one could use the lambda to scan incoming request metrics and scale down on that.
by 300bps on 9/8/21, 12:15 PM
The person that set this up got an amazing education on use of real-world AWS services.
A lot of IT people aren't aware that things like this exist. They think moving to the cloud means sending all your virtual servers to your provider of choice and running them 24x7 like you did on-prem. In my opinion it's more about architecting solutions so that resources pop into existence for the exact # of milliseconds they're needed and then they're released. This is a clever step along that path.
by tlarkworthy on 9/8/21, 11:35 AM
https://observablehq.com/@tomlarkworthy/minecraft-servers-be
it never really took off so I mothballed it, however, I do use it at home for our personal server and it has saved me a ton of money! It makes perfect sense as you can have quite a good spec machine when you are paying by the hour. you just disconnect the disk from the VM and pay for disk storage which is very cheap.
It was based on the following terraform recipe (which I wrote)
https://github.com/futurice/terraform-examples/blob/master/g...
by academia_hack on 9/8/21, 10:34 AM
Edit: Just saw that the GitHub includes a link to an AWS calculator. Looks like a month of continuous usage caps out at $40-ish. Not too bad since my realistic worst case is probably more like 8/hrs per day rather than the full 24.
by bussierem on 9/8/21, 8:14 PM
This is PHENOMENALLY DOCUMENTED. I am thoroughly impressed, @doctorray. Clear and easy to follow walkthrough and explanation of how it works, amazing troubleshooting tips, suggestions for managing it... This is an exemplar of a well-made README for a service. Bravo!
by vultour on 9/8/21, 11:00 AM
by endgame on 9/8/21, 11:55 AM
by meekins on 9/8/21, 11:13 AM
by shog_hn on 9/8/21, 4:23 PM
https://www.shogan.co.uk/gaming/cheap-minecraft-server-in-aw...
by 7ewis on 9/8/21, 11:34 AM
Wondering if services like Google or Shodan may have tried querying it and causing your server to turn on?
by aweiland on 9/8/21, 12:32 PM
by simonw on 9/8/21, 7:02 PM
I just wish there weren't so many steps to get this kind of thing running! Even with automation it's still a LOT - getting this running myself would take me a few hours, and I have prior relevant experience.
A regular non-software-industry-professional parent has little chance.
I really wish there were better ways to make AWS stuff like this available for people to use without requiring them to have deep knowledge of how to work with different aspects of AWS.
by jonnycomputer on 9/8/21, 1:26 PM
by flatiron on 9/8/21, 11:12 AM
by ylyn on 9/8/21, 6:39 PM
I did this with a Minecraft plugin that would schedule a systemd shutdown in 30 minutes when the last player disconnects, and cancel the shutdown if a player connects.
Then a simple webpage that sent an EC2 API request to power on the instance, and a simple plugin that sends a Telegram message when the server is ready for connections.
by TheDudeMan on 9/8/21, 2:33 PM
This qualifies as "serverless" now?
by bingohbangoh on 9/8/21, 3:00 PM
by l30n4da5 on 9/8/21, 1:16 PM
A lot less chance of me spending $$ that way.
by pkilgore on 9/8/21, 1:27 PM
by soobrosa on 9/9/21, 6:10 AM
by mt_ on 9/8/21, 12:57 PM
by stiltzkin on 9/8/21, 4:36 PM
by Aissen on 9/8/21, 12:13 PM
Concerned about cost overruns?
Set up a Billing Alert! You can get an email if your bill exceeds a certain amount. Set it at $5 maybe?
It's 2021 and the biggest cloud platforms still don't have hard limits on spending.by unnouinceput on 9/8/21, 12:57 PM