Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
asgs115623yIs Hibernate the same as stopping? If so, I think it would incur storage costs
Also, serverless sounds like it is doing what you want -
@asgs Hibernation isn't the same as stopping, at least not at AWS. Though you're correct that some storage costs would be unavoidable. That being said storage is cheap, and definitely cheaper than having the server run 24/7.
And I haven't ever touched serverless, but based on what I've heard I don't think it's suited for Minecraft servers. -
hitko31483yShort answer: you can't, at least not in a way that would be cheaper than running your server 24/7.
Long answer: Minecraft protocol dictates that your server needs to have a fixed endpoint and session from the start, and doesn't support redirects. This rules out any possibility of using lambda or another event-driven listener for incoming connections, that would in turn start your instance and redirect any further requests to it. It also rules out the possibility of using some sort of routing rules to internally do the forwarding, because it would disturb the session (although it might work for the first player to start a session, wait a minute or so for the internal VPC redirects to come in place, and then join again within some grace period before instance goes back to hibernate). Anyway, even though it is technically possible, you would at minimum need either a NAT + lambda, or a small proxy instance you'll keep online 24/7. -
hitko31483y@hitko NAT would cost you about as much as running a 15-person server 24/7, while the smallest feasible proxy instance costs 50% of a 5-person server.
-
@hitko Yes, a proxy is in order. That's also why I mentioned Velocity. You could probably get a way with a single proxy server for multiple instances, cutting the costs even further. I think that pretty much answers your comment.
-
synemeup3143yHasn't that been a thing for quite some time now? I remember seeing "Please try again in a minute, server is starting up" when connecting to a server.
-
hitko31483y@ScriptCoded Keep in mind that you're looking at really low numbers here. It's like the birthday paradox, even with only a handful of players the probability of someone being online at any given time quickly approaches 1 (see image for the general shape of the related probability distribution). At those low numbers, the proxy instance costs you almost as much as the actual server instance, so the only way to make it viable would be if you could somehow get rid of the proxy instance and instead use some "nearly-free" AWS solution such as lambda, but as discussed in my first comment, that's not possible.
-
synemeup3143ySearching for "minecraft server hibernation" gives me this: https://github.com/gekigek99/....
It's apparently written in Go. Maybe it's possible to modify it to properly work with AWS :D
Neat stuff. -
@hitko Well, no case is like the other. I'm running a server with a few friends, and we all live in the same country and don't really play during the days. Some days we don't play at all. If I were to guess I'd say we utilize no more than 20-25% during a month. Add to that that a Minecraft server requires a lot of resources and I think I'd save a buck. I might run the numbers tomorrow just to check. Also, in our case it's also a modded server, which means even more demand for resources.
So no, it probably isn't for any server, but with a bit of load I think it could make sense.
I'll try and run the numbers tomorrow -
hitko31483y@ScriptCoded Look, the cheapest instance you could use on AWS costs $0.0047 per hour, and I'm not even sure it could run Velocity for a single player, since it only has 512MB RAM and most of that would be consumed by OS and JVM. You'll probably need something at least twice as expensive just for the proxy, which adds up to about $7 per month. Running a proxy means you'll also pay $0.01 per GB of internal traffic between the proxy and the server, which adds to about $0.3 per hour of play time. Then there's an extra disk which might be cheap, but it still adds about $2 per month. That's already $21 per month just from running the proxy server 24/7 and playing 40 hours per month. For comparison, most game server providers charge less than $20 per month for dedicated Minecraft servers that can support between 8 and 15 players (modded) and up to 40 players without any mods.
That's how thin those margins are. -
That would be interesting to have, I tried with some connection detection mechanism inside the EC2 instance linked to an EIP, but Minecraft always timed out the connections because it was expecting the server to be already alive.
I started looking to develop a Discord bot for this but didn't get far (primarily because of time and money). -
@hitko Well, firstly, nothing is forcing you to run the proxy on AWS. You could very well run it on DigitalOcean, or any other provider. A $5 Droplet has plenty of capacity for the Velocity. Velocity doesn't really require a lot of resources. It's lightweight AF. You can get away with 1GB of RAM with no issues whatsoever in my experience.
Secondly, the more servers you host the cheaper that steady cost becomes if you look at it on a per-server basis. Me myself is currently running 2-3 servers, and I have a friend who I'm sure wouldn't have anything against having his server run cheaper as well. That pretty much negates the steady cost.
Using RAM as a baseline, two of my three servers run with 8 GB, and assuming i utilize them to 25% (averaged out it's probably closer to 15%) I could run the server itself at $20 a month instead of the $48 I pay today. That's not including the cost for the proxy, but at these figures it's already a win. -
@Berkmann18 Well, if you'd be interested in bouncing off a few ideas I'd be happy to talk.
A way of running Minecraft servers on AWS and automatically hibernate instances when there are no players online.
A way of running Minecraft servers on AWS and automatically hibernate instances when there are no players online.