r/programming • u/ZEROxSENSE • Jun 27 '19
On Demand Minecraft Server which operates at minimal costs for small, casual communities. I’ve just open sourced it and hope it sees some use!
https://github.com/trevor-laher/OnDemandMinecraft36
u/drysart Jun 28 '19
So now this gives me another idea for something like this: instead of the server control being done through a web application have a service that can be run on an always-on t3a.nano instance (around $3.5/month) which will:
Accept connections from the Minecraft client,
If their on-demand server isn't already running, put the player into a simple waiting room to wait (no gameplay or anything, just the bare minimum to satisfy the Minecraft client); issue the AWS commands to start up the on-demand server; when the on-demand server is started, connect to it and proxy the player's connection to the server with whatever protocol trickery is needed to make the client think it just got teleported there.
If the on-demand server is already running, just proxy a connection to it and log the player into it transparently.
When a connection closes, if it was the last proxied client, save and shutdown the on-demand instance after a short delay.
15
u/ZEROxSENSE Jun 28 '19
That’s very interesting and a little bit outside my expertise. I could see this type of setup turn into a distributed computing version of Minecraft multiplayer. I’m not sure what problems you’ll encounter trying to scale this outside of the 1 - 15 player range. Good luck!
1
u/Snakeven0m Jul 02 '19
Isn’t it not too far off what the huge minecraft servers that support 15k players plus do? It just instances all the servers and swaps them seamlessly, unless there’s some more black magic stuff going on behind the scenes.
EDIT: just realised another user commented about this system, it’s called bungee apparently. Seems like it could work though.
13
u/Meldanor Jun 28 '19
I was into Minecraft plugins with Bukkit (about 8 years ago) and your scenario is doable. There is a Spigot Plugin called Bungee which exactly is this case. You could teleport between worlds, but the worlds are hosted on different servers. A central proxy directs your traffic.
Here is the repository: https://github.com/SpigotMC/BungeeCord/ Glad to see, that it is maintained after so many years.
7
u/Conscars Jun 28 '19 edited Jun 28 '19
A while ago I created a TCP proxy which sits in front of minecraft servers. When the first player attempts to connect, it starts up the EC2 instance with the minecraft server and parks the incoming connections until it's done. Once the server is up, it acts as a simple TCP proxy which players aren't aware of. After a period of connection inactivity it will shut down the EC2 instance. This lets you run the proxy on a commodity server and the minecraft server on something more powerful, but on-demand.
https://github.com/csauve/servercraft
In the README I mention that the first player to join may experience a timeout while the instance starts. Someone here might be able to optimize server startups better than me. I tried class data sharing for the minecraft server but it didn't help much.
3
u/drysart Jun 28 '19
the first player to join may experience a timeout while the instance starts
Yeah that's where I think having a small hardcoded "waiting room" to drop the player into would be useful.
3
u/dragonatorul Jun 28 '19
I don't think that's possible from within the minecraft client itself, but you could create a custom client which checks if the instance is available and tells you to wait until it becomes available, or starts it at the same time as you start the game. I'm playing FTB packs so it takes ages to boot up my client. The server would probably be faster if it started at the same time as my client.
1
u/Spajk Jun 28 '19
Problem is "knowing" which on-demand server they are supposed to connect to.
1
u/drysart Jun 28 '19
That's not really a problem. There are 65,535 ports (minus a small handful) that you can connect to on a cloud VM; and Minecraft fully supports connecting to a server on an arbitrary port.
If you want server 1, you connect to port A. If you want server 2, you connect to port B. The lobby server would just have a simple configuration map of which listen port is associated with which backend on-demand server.
1
u/midri Jun 28 '19
Not how the Minecraft client works, you'd have to login to web portal then have a link that launches you into the server once it's up, this can't be done from within Minecraft itself.
11
u/drysart Jun 28 '19
Yes, this can be done from within Minecraft itself. As far as the client's concerned, it's just connecting to a server. All the magic would be done server-side. The client would just see that it logged into a room, then a short time later that it got teleported somewhere else.
This is how a lot of the huge Minecraft servers work, where you actually connect to a smart proxy that connects to back-end servers on your behalf based on which sub-realm of the server you transport to; the main difference here would be that the lobby isn't a fully functional server itself, it'd just have the bare minimum functionality to stick you in a room while it managed the starting and stopping of the on-demand server before proxying you to it.
1
u/midri Jun 28 '19
Interesting so someone wrote a "lite" server that has proxy capacity, can you link me to any examples?
2
u/drysart Jun 28 '19
Someone else just commented with one they built that does basically what I described.
1
u/midri Jun 28 '19
Right, but they specifically say it's just a TCP proxy -- which has nothing to do with the minecraft client itself and actually has a poor experience since it can cause connection timeouts whilst spooling up the server.
2
u/drysart Jun 28 '19
BungeeCord does the protocol hackery and proxying that I described, but it's a bit wider in scope than what I described as something purpose-built and simple enough to fit into a tiny $3.5/mo AWS instance.
Basically it'd be something with the protocol-level fakery that BungeeCord does with the dynamic instance launching and shutdown that the other linked project does.
53
u/noahc3 Jun 28 '19 edited Jun 28 '19
Hmm, interesting concept but I would say for "up to 20 players" that is mentioned in the README it sounds likely that the server may be running for more than 168 hours per month (7 full 24hr days, or 5.6hrs for 30 days). At 0.0208/hr you're better off getting a cheap DEV1S server from Scaleway for €2.99, plus that will have way better hardware.
If we are talking a server with a group of 5-10 friends playing vanilla, then this makes a ton of sense. At 0.0104/hr you'd be running for 14 full 24hr days before the cost exceeds that VPS, and chances are you're running at the very most 8 hours a day? Probably closer to 2 or 3 hours on average. At the max 8 hours you'd be looking at $2.5/month or no more than $1 at the more realistic average.
Something interesting to expand upon this might be to write some custom server software that could utilize the spot instances, but thats way out of scope :P Though with autoscaling it might be possible to drop the cost even more without too many issues.
30
u/ZEROxSENSE Jun 28 '19
Very good analysis. That’s a very good idea in fact. Minecraft is such an awesome game and it’s a shame to make people pay so much to enjoy it together. If spot instances can make this cheaper with more uptime I think you might be on to something. Didn’t even know those exist!
12
u/NinjaPancakeAU Jun 28 '19
Quick addition: normal Spot instances can (depending on region, often aren't though) be terminated at any time (you get 2 min warning), but there are other kinds of spot instances with 'block durations' of 1-6 hours (eg: AWS promise that unless the sky is falling, your spot instance won't be terminated for 1-6 hours)
2
u/SgtDirtyMike Jun 28 '19
It’s really not hard to build a cheap server or repurpose an old PC or laptop. That’s what I’ve always done. In fact I ran a home server for many years with around 30 or so players.
12
u/TheThiefMaster Jun 28 '19
Note: if you pay the electricity bill it can actually end up more expensive to run your own server, depending on the efficiency of the hardware you use.
24/7 on an old desktop is not a recipe for cheap running. If you average 100W, at UK price it costs ~£12.50/month
I used to have a server that averaged 200W... Upgrading it actually paid for itself!
6
u/SgtDirtyMike Jun 28 '19
My electricity bill was fixed so it wasn’t a problem. Thus my cost was $0. Also, I’m in the US. Remember guys it’s not bitcoin mining, it’s running a Minecraft server. You can easily do so on extremely efficient hardware. The new Raspberry Pi’s could probably run a small server pretty darn well and it has a very low TDP.
3
u/TheThiefMaster Jun 28 '19
Sure, but then it wouldn't be repurposing an old PC. Also adding an appreciable amount of storage to a Pi would be a mess.
I want one of those new RPi's, but I don't have a good excuse.
4
u/SgtDirtyMike Jun 28 '19
BTW repurposing an old PC, doesn’t necessarily mean you’d hit 100w either. Friend of mine ran his server on a core i5 laptop wired directly into his modem. TDP was like 60 watts max. That’s under full load, which it wouldn’t be constantly.
2
u/techdawg667 Jun 28 '19
You can get A2 microSD cards which are rated for 4K read IOPs and 2K write IOPs, more than enough performance for a minecraft server. A 64GB/128GB one costs $15/$20 on amazon right now.
9
u/88omega Jun 28 '19
That is if your ISP allows port forwarding
4
u/SgtDirtyMike Jun 28 '19
Most IPs allow port forwarding. It generally depends on your router and modem setup. I’ve used 4 major ISPs in my area to host a server. All worked just fine.
14
u/connor4312 Jun 28 '19
This is really neat! I was into Minecraft hosting several (~six) years ago and did something similar. It failed for a few reasons, but it's really neat to see your take on it. Keep at it :)
7
u/ZEROxSENSE Jun 28 '19
Thanks :) I’m really trying to make communities able to pick up and play, and drop it a week later. Other methods require a subscription, but with this system people only have to pay to store the world if nobody is playing.
9
u/DoublePlusGood23 Jun 28 '19
I think this is what I've been looking for.
I have a server for me and a friend that we only play on for a few hours a week.
Would it be possible to use this on Google's serverless offering?
5
u/ZEROxSENSE Jun 28 '19
I’m not exactly sure what you’re referencing. This should work on any cloud computing service hosting a Linux instance. It must be able to keep the Minecraft server process running, and a CRON job to make sure the server isn’t empty.
3
1
u/notathr0waway1 Jun 29 '19
I know AWS' serverless has an execution duration limit. I think they are up to 30 minutes now.
If Google allows indefinite execution, maybe.
6
Jun 28 '19
Would you be open to PRs? I work in DevOps/Infra and can automate most of the EC2 setup and server provisioning.
4
u/ZEROxSENSE Jun 28 '19
Yeah I’m not opposed. I’ll have an update to the repository soon!
1
Jun 28 '19
Cool. Thanks for doing this! Haven't had a chance to test it out yet, but will definitely give it a try. I've been working on a system to run spigot in a container and auto-update the version and plugins.
2
u/Andrew1431 Jun 28 '19
Brilliant! I’ve been wanting to do this for MORDHAU and interface with it as a discord bot for my community!
2
u/ZEROxSENSE Jun 28 '19
Oooo a discoed bot is an excellent idea. I’d be very interested in linking such a thing in the readme if you made it. Certainly beats my UI!
2
u/chaswell Dec 02 '19
Took me a couple of hours, mostly because I'm rusty and partially because I'm slow. Works great, directions are accurate and when followed in order, it was error-free.
Thank you, if I had gold or anything, I would give you some.
1
u/ZEROxSENSE Dec 02 '19
So glad to hear. There have been a lot of people posting issues on github so I’m glad to see where the errors were. I’m hoping to have this fully automated in the future. Enjoy playing!
9
u/dragonatorul Jun 28 '19
That's a very good idea. Good work!
Just off the top of my head here are some of my feature ideas:
Have the option of using spot instances, maybe with auto-calculating cost. (check what the current cost of a spot instance is, how it evolved recently, and choose a bid that's just a bit above the estimated cost)
Support FTB (which is what I play), possibly with custom mods. Store the mods in an S3 bucket and get them from there before starting the server.
Copy logs and crashdumps to S3.
Store backups and world saves in an S3 bucket.
Store minute by minute list of users in a database, to use at the end of the month to see who used the server and possibly distribute the cost to the player base fairly.
Use an S3 bucket to serve a front page that controls the entire process using lambda functions and uses Cognito for authentication to prevent attackers from forcing your instance open all the time.
Use SNS to send various notifications to the admin via email/sms/push, etc. when: server started, server up for more than 3,6,8 hours, etc.
Check billing info and stop the instance and stop creating new instances if the bill is too high.
Use Route 53 to assign a domain name to the instance each time it is created, so you won't need to change the IP in the client.
If I have time I may look into implementing some of these.
1
u/dwncm Jun 28 '19 edited Jun 28 '19
I implemented smth similar a while back. That's a really good way to provide a server if you play with a small group of friends and not very often. Unfortunately, the Minecraft server itself requires some maintenance - after about a year it became noticeably slow on the same-sized instances.
Do you use AWS spot instances? It cuts down costs A LOT with one major drawback - server may reboot at any time with a few minutes (iirc) warning.
I don't remember whether I uploaded my stuff to github (I'm using my phone right now), but ping me if you're interested - I'll share my implementation.
1
u/ZEROxSENSE Jun 28 '19
I haven’t used spot instances. That would be extremely annoying as the server would go out while people are playing. Would certainly cut down costs a lot but that would have to be a different project as I think a lot of functionality would be sacrificed for it.
1
u/peachZ90 Jun 28 '19
Starred, and watching your repo. I will look at this when I am at home.
I wonder if it is possible to use this with modded minecraft versions.....
2
u/ZEROxSENSE Jun 28 '19
It should be possible! Will just require a little bit more configuration for start up scripts and FileZilla maintenance.
1
u/Shwiboo Jun 28 '19
This is a fantastic idea how easily could I use something like this for a Factorio headless server for instance?
1
u/ZEROxSENSE Jun 28 '19
Changing the startup commands and CRON scripts might make it work. Don’t know how you’d go about making sure the server shuts down if it gets full. Certainly could scale to any other game but might require manual shutdown instead.
1
1
Jun 28 '19
Can someone explain to me what you need to do this?
2
u/ZEROxSENSE Jun 28 '19
Check out the readme, I’ve had this working for a while but I spent a ton of time yesterday making the readme cover every step of the setup.
1
1
u/LurkingReader Aug 21 '19
I've been wanting to do something like this as practice and also got back into minecraft.. but hey why re-invent the wheel.
I do have some questions however.. I'm not up to date on how the minecraft aspect of this really works. When you go to shutdown the server.. does minecraft know a shutdown has been issued and it does all of its backups natively? Meaning it just freezes the state of the game kinda and then EC2 is using EBS so no need for an S3 bucket since the data on EC2 is going to remain after shutdown, correct?
I'm going to look into creating a discord bot so I can control turning on/off the server from my phone in discord app.
There is someone else who did this same thing but they reserved Spot Instances however I think the code (custom AMI's they created) and some other aspects have changed and it doesn't seem to create the cloudformation stack properly.
So in a nutshell, this is just a walkthru of how to create a EC2 instance and then load minecraft on it. Which is same thing as loading a minecraft server on your own PC (with the exception of doing local port forwarding and stuff).. Then it comes with some fancy heroku page to control the EC2 instance.
I like it!
1
u/ZEROxSENSE Aug 22 '19
I believe the shutdown called for the AWS server will wait for all processes to shutdown properly thus saving all the Minecraft data. I’ve yet to encounter any saving issues regarding the world and the shutdown script. Yes, the instance is saved and no S3 bucket is required, but that could change if your world size got absurdly large. Open source the discord bot, I’d certainly use it and help improve upon it.
1
u/LurkingReader Aug 22 '19 edited Aug 22 '19
Can you dissect this a little bit for me? Everythings up and running great, but I saw a comment on modding minecraft. You had mentioned some update to the code.. is it just updating the party of the code that launches server.jar to the new modded jar..? seems like thats all that would need to happen. not sure if the autoshutdown would still work and autosaves.
EDIT: Also I don't see the static/js folder so my website isn't really doing anything cause it cant' run startServer.js
1
u/ZEROxSENSE Aug 25 '19
Yeah I haven’t tested it, but if the player list command will still pop into the same log with a modded jar, i believe it should still work. In the auto shutdown you’d have to make sure all the references to server.jar are instead pointing to your modded jar file but I think that’s it! Good luck - feel free to add your findings to the readme☺️
1
u/LurkingReader Aug 26 '19
What about that JavaScript file? I don’t see the startServer.js file on GitHub. So my button launches the EC2 instance, but Minecraft server doesn’t auto start.
1
u/ZEROxSENSE Aug 27 '19
I’ve removed the startServer.js file. The webpage now has an embedded call to the server.py file which calls the server there. You can find the command that gets run to start the Minecraft server in the initServerCommand method of server.py. Might be a configuration issue on the EC2 side which is causing the issue.
3
3
3
u/bananasdoom Jun 28 '19 edited Jun 28 '19
I've been wanting to do this but have the server spin up when enter a specific discord channel.
1
u/Noneatme Jun 28 '19
It's a cool idea, but with a cost of 0.02$ per hour it would cost around 0,48$ per day, 3,36$ per week and 13,44$ per month if there is always someone on the server.
If the server is crowded most of the time, it would be better to just get a root server. For this money, you can get one with 4 cores, 16GB RAM and 450GB of space.
4
u/ZEROxSENSE Jun 28 '19
Right, it’s really only justifiable for small groups of players. Once players are always on the server On Demand EC2 instances are being used wrong.
2
2
u/Zambini Jun 28 '19
This rules. That's a great project with a great cause, you might even be able to run managed versions to reduce the complexity even further for people who don't know any of this stuff (albeit assume some liability, SLA like things, and licensing).
1
u/punppis Jun 28 '19
Its cool but is all of the trouble really worth few dollars a month? There is also a chance that there is a bug which causes a zillion instances to spawn or something similar which would eliminate all the savings.
1
u/Zinlencer Jun 28 '19 edited Jul 01 '19
Sorry, but which license are you using?
Edit: looks like a license file was added in the meantime. It's the MIT license.
1
u/GooberMcNutly Jun 28 '19
Perfect timing. My daughter wanted a server for her squad, bit I didn't want to host and didn't want to pay big for ec2. I'll fork if I have anything to add.
1
u/placuaf Jun 28 '19
Wow that's seems awesome, I recently came back to Minecraft and was thinking of paying for server. I will definitely try that!
1
u/thebritisharecome Jun 28 '19
I hadn't even thought of this use case for Cloud, thank you for sharing!
1
u/BladesShadow Jun 28 '19
I'm not very knowledgeable about this type of stuff (or most things at all) , but would this also let you host your own modded version of MC?
Sorry for the basic question!
1
u/MaximRouiller Jun 28 '19
Hi!
No clue what AWS has but I know that Azure has Burstable VMs. It's called B-Series. Think of it as paying less than full price, accumulating credits, and being able to use those credits automatically to get more performance.
This is exactly what it's good at. Since the minimum requirements for a Minecraft server is quite low (even for a 1-10 player scenario)... let's check on the price real quick. For a 1GB of RAM VM, you can get it for about 7.5 USD per months or for a bigger machine, you can get one for 15 USD per months (Source).
If you combine that with a more dynamic allocation like with your Heroku application... you can basically get it for pennies. Having an automated shutdown task on the VM as well will help you reduce your costs as well.
I'm sure there is an equivalent on AWS and GCP but I don't really know those service very well. Just giving ideas on how to architect things to help you save even more money. 😊
Let me know if that helps!
PS: I work at Microsoft as a Cloud Advocate.
1
u/WarInternal Jun 28 '19
If these instances can be dockerized you might look into fargate. It looks like it might give you more control over per instance resource availability without having to manage the underlying infrastructure yourself.
1
u/visualdescript Jun 28 '19
Thanks for this, will give it a look. I recently started renting a server playing with a couple of friends and did consider managing it myself, but didn't want to invest the time.
This looks interesting!
1
0
Jun 28 '19
I would very highly recommend never to put you aws access/secret key anywhere locally inside your repository. If you accidentally commit and push this, get ready for a nice large aws bill from someone else using your account
0
-12
u/SpiritenHasArrived Jun 28 '19 edited Jun 28 '19
This is already a thing and is pretty expensive to run....
Edit: why am I being downvoted?
9
u/ZEROxSENSE Jun 28 '19
It’s already a thing, it was the original inspiration for this project. I’ve layered it with a very simple UI to make it more accessible to users than simple scripts.
-2
u/SpiritenHasArrived Jun 28 '19
Why not use something, well, affordable? This ends up costing like $30 a month
0
Jun 28 '19
[deleted]
91
u/ZEROxSENSE Jun 28 '19
Depends entirely on how many hours it hosts for. What’s your server bill? Mine for the month is $.60
41
u/couscous_ Jun 28 '19
Mine for the month is $.60
What provider are you using?
Edit: it seems you're using Amazon. Is this over Lambda?
52
45
u/ZEROxSENSE Jun 28 '19
It’s not over Lambda, not sure that’s possible. You have to wait for an EC2 Instance to launch any time the server is rebooted. Most of your questions can be answered in the readme!
12
u/Techrocket9 Jun 28 '19
It sure wouldn't be easy. You'd have to rewrite the entire backend to sink state to Dynamo.
Even with DAX you'd need to overhaul the update logic to handle synchronization issues.
It would be an unbelievably huge project, and the end result would probably be jankier than a normal Minecraft server.
It would be cool though.
25
9
Jun 28 '19
Lambda has a timeout of five minutes. It's not meant for long running processes
9
u/Techrocket9 Jun 28 '19
15 minutes now, but yeah.
You'd have to rewrite the server to be a series of discrete endpoints that spin up Lambda functions which pull in state from Dynamo, update it, and then terminate.
That way zero compute is running when no one is playing and as much compute as necessary is running when people are online.
This model is used all the time for web apps and turn-based games, but I've never heard of it being used for a real-time game like Minecraft. It would be a really fun challenge to try and pull off.
-1
Jun 28 '19
That means every fifteen minutes the users would have to reconnect. It's a challenge for sure, but probably not one that's useful.
3
u/Techrocket9 Jul 01 '19
You'd build it so that a separate Lambda invocation is used for every API call that the client makes.
When the client asks the server, "What blocks are in chunk 845x384?", API gateway will invoke a Lambda function that looks up the answer in Dynamo/DAX and returns the contents of chunk 845x384 and then exits.
When the client mines a block it will send a request to API gateway saying, "Hey! I mined the block at 123x488x78", API gateway will invoke a Lambda function which will update Dynamo to mark block 123x488x78 as mined and then exit.
There will be many thousands of very short Lambda invocations.
It would be highly cost ineffective for a large number of players (since Lambda can be >8x as expensive as EC2 when saturated), but if you only had a couple players logging in a couple times a month it might save you some cash.
Dynamic updates would also be tricky; you'd probably need a Lambda triggering every eighth of a second from a step-function off a cloud-watch trigger to compute them and write the results to Dynamo.
1
0
u/Zambini Jun 28 '19
I believe you can have a lambda trigger off of an EC2 lifecycle event (eventually, I think you'd have to run an SQS as well and have the EC2 instance push update there). But I don't see much value in adding all that extra complexity vs how you've set it up
70
u/nastus Jun 28 '19
It’s funny because you can run minecraft next to free with a decent vps < 5$ at ovh
32
u/Zambini Jun 28 '19
I don't see anything but vanilla minecraft running smoothly on a single virtual core @ 2Ghz with only 2gb total system ram.
Most of the mods I have run wound up requiring 4gb ram and a fairly decent proc for anything that wasn't immediately stuttery and hellishly laggy.
15
u/tuoret Jun 28 '19
I've never even managed to get vanilla to run smoothly on a low-end VPS. Maybe if you only have a maximum of 2-3 players who are all in the same area, otherwise the RAM and CPU just aren't good enough.
33
u/MINIMAN10001 Jun 28 '19 edited Jun 28 '19
I've always thought at that budget id try vultr or ramnode.
Although your concept of nearly free is different than mine. For web projects I have a 128 MB server for $2 a year because I wanted a server that I would rarely use but was nearly free.
16
Jun 28 '19
Where do you get a server that cheap?
24
u/axzxc1236 Jun 28 '19 edited Jun 28 '19
I know there is Gullo's Hosting offering $2 a year. (I'm in no way affiliated with the provider.)
I currently own a OpenVZ mini from Wishosting for $3 a year, 256MB RAM, 40GB hard drive and no traffic limit, but be aware that I've been experiencing 2 down times in the last month, it went down for like 8 hours for me last time. (Despite the down time, I still love my OpenVZ Mini)
(Note that in deals above you are stuck with Linux kernel 2.6 because they use OpenVZ 6)
6
u/nullmove Jun 28 '19
No wireguard then :(
8
u/axzxc1236 Jun 28 '19
Your comment got my curious about running Wireguard in old kernel.
Technically you can do it with wireguard-go.
There is even a chinese article detailing how to compile it from zero. (obviously I didn't test it)
** Note that the author of wireguard-go doesn't recommend using it.
2
u/nullmove Jun 28 '19
Yeah, I didn't think the userspace implementation is stable enough, but worth a try I guess. Apparently there is also a Rust implementation by cloudflare.
2
u/axzxc1236 Jun 28 '19
I forgot to mention that Hostdoc had a $4/year NAT KVM deal.... that was amazing.... (KVM allows you to install custom kernel)
But according to 3rd party website they disappear in like 16 minutes after restock.
3
u/MINIMAN10001 Jun 28 '19
You guessed the provider correctly Took me longer than I wanted to track down. Wishosting is hosted in France as I'm in NA. But it isn't entirely surprised because EU seems to have lower server costs.
8
u/Rhys4995 Jun 28 '19
Try Hetzner. They have a couple data centres in Germany and by far the best value for money I've seen so far. Cheaper for more resource than Digi Ocean/AWS etc...
3
u/Sightline Jun 28 '19 edited Jun 28 '19
Yeah, Hetzner has good prices. The web interface needs a touch-up, but that's it really.
2
u/Swedneck Jun 28 '19
I get 500GB of nextcloud storage for 6 EUR there, it's missing some features but it's damn cheap
1
u/Rhys4995 Jun 28 '19
Hetnzer have updated their cloud UI a lot in the past year or so, so its a bit nicer, but for their prices I can forgive any sloppy UI
3
7
u/YM_Industries Jun 28 '19
How do you get a domain that cheap?
The only cost associated with my blog is the domain registration, everything else is free.
8
u/MINIMAN10001 Jun 28 '19
Freenom has free domains. However Cloudflare has .com domains for currently $8.03 and they are selling them for no profit. So that's as cheap as it can get without a business losing money on selling a domain name.
10
u/MaxCHEATER64 Jun 28 '19
.ml/.tk domains are free
8
u/ImaCallItLikeISeeIt Jun 28 '19
from what site?
4
u/axzxc1236 Jun 28 '19 edited Jun 28 '19
I searched for it, and looks like you don't need to pay for .ml .tk .ga .cf and .gq, for 12 months.
On point.ml it says you need to renewal every year or it expires.
1
7
u/Joniator Jun 28 '19
dot.tk for tk domains, but be warned that they block the domain for a free months after your free plan expires and you have to pay for it (IIRC more than average for a cheap domain, and freenom isn't really the most flexible dns management). Better take the hit and spend $10 a year a namecheap or godaddy
3
u/nullmove Jun 28 '19
You don't necessarily need to manage it using Freenom, just change namaserver. I have been using it with Hurricane and it's a pretty solid free service. But yeah, I would second not using Freenom for anything serious.
0
u/MaxCHEATER64 Jun 28 '19
That's a complete lie. If you renew it under the 12-month plan it is always free. If you want to reserve it for several years it's less than $10 a year. Stop spreading misinformation.
2
19
u/YM_Industries Jun 28 '19
And because of that, those domains are often used by scammers. If you host there website there it will look untrustworthy and often be blocked. Article
11
u/skocznymroczny Jun 28 '19
Hmm. I wonder. .ml domain sounds like it would actually be quite valuable, because it sounds like "machine learning".
3
15
u/RoboYoshi Jun 28 '19
who cares tho? If you're not running a business the internet is an open space for sharing. I do not care about the TLD at all if it's running a minecraft server
3
u/YM_Industries Jun 28 '19
I was responding to "For web projects I have a 128 MB server for $2 a year". Plenty of web users have web filtering on their PCs, if I'm hosting a website I'd like for everyone to be able to access it.
1
2
u/MaxCHEATER64 Jun 28 '19
That article doesn't support your claim. I've never had my domains be 'blocked' in any capacity that I am aware of, and I've been using TK/ML domains for almost a year.
-14
u/KryptosFR Jun 28 '19 edited Jun 28 '19
No service is ever free. If you don't pay a bill, it means you are the product.
Now, what does it mean for those domains? Can they sometimes redirect it and use it for spam/scam/phishing purposes and let you have the blame?
16
u/axzxc1236 Jun 28 '19
Linux kernel is free, and I don't think I'm being sold in anyway for using it.
6
u/KryptosFR Jun 28 '19
Irrelevant to the conversation. Linux is not a service.
7
u/axzxc1236 Jun 28 '19 edited Jun 28 '19
Aww... sorry.
I would argue that GPS system is free for people that isn't living in United States. (And I don't think my cellphone can transmit my location back to satellites)
→ More replies (10)3
1
2
u/daymanAAaah Jun 28 '19
Vultr is the way to go. I have an FTB infinity evolved (so lots of loaded chunks and lag) running on a 2cpu 4gb ram machine for $20/mo and it works great.
I got some surprise bills using AWS or GCP with bandwidth usage. For a simple MC server just get something with fixed pricing like Vultr or Digital Ocean.
2
u/nastus Jun 28 '19
I just thought I'd say that ovh has their KVM vps for 18.49 CAD/mo where its 2 cores 8gb of memory and 80gb of ssd. Definite con is the 100mbit network, but for mc you're entirely fine.
I've found that if you want guaranteed resources it's hard to beat ovh for their price.
1
u/nastus Jun 28 '19
At the price I've found every other provider to be more expensive, the dynamic changes at dedicated server prices (at least in my experience).
Also yeah that is fair, for me next to free is the cost of a coffee in my city so it is certainly relative!
1
Jun 28 '19
Minecraft needs at least a gob of ram, if not several
2
u/MINIMAN10001 Jun 28 '19
The empyrion server I'm playing on right now has to restart every 3 hours because it "only" has 128 GB of ram. The EU server has 384 GB of ram.
2
u/Shadonovitch Jun 28 '19
Been there, done that with a 5$ droplets at DigitalOcean that was hosting some websites in Docker too. 1gb of ram ain't enough if your players are exploring the world. I now have a dedicated server 4gb ram for 20$/month (but i had 300$ credits offered, so there's that) at Google Cloud Platform and still have lag issues with >5 players.
1
u/nastus Jun 28 '19
The lowest they offer is 2gb for 4.49 CAD, 4 for 9.49 CAD. I Almost sound like a spokesman
13
u/tom_echo Jun 28 '19
The point is turning it off when you’re not using it. When you pay on demand hourly pricing and play only a few hours a week/day/month then it’s cheaper.
8
u/Ph0X Jun 28 '19
Exactly, for small servers this is huge. When I used to play with my friends, we were like 5 people and we'd play maybe 3 hours week days and 5 on weekends. That's like at most 25h per week, 100h per month or 2$ on this thing.
7
u/pet_vaginal Jun 28 '19
AWS has overpriced crap because they can. Companies will pay the high cost because it's definitely worth it.
What's annoying as a personal consumer is that most other large cloud providers aligned their prices to AWS.
If you don't need more than 10% of AWS' features, which might be the case for a gaming server, I can recommend OVH (especially kimsufi or soyoustart) or Scaleway.
9
u/swansongofdesire Jun 28 '19 edited Jun 28 '19
I wouldn't say that AWS is overpriced crap.
Yes, for basic VMs AWS is overpriced, but not when you're the target use case: being able to scale up (or down) quickly.
If you have a simple VM that is going to be up 24/7 then AWS is overkill and a waste of money, but when you actually do have a nail then it makes a fine hammer.
Companies will pay the high cost because it's definitely worth it.
My experience has been that a significant number of companies pay because they don't actually understand the costs. Their WordPress site does not need to be load balanced with an RDS failover setup but their web developer read an article on Medium on how easy it is to set up and didn't stop to think about whether they actually needed it.
3
Jun 28 '19
I've had a ton of good experiences with ssdnodes so far. IMO worth it on a sale though. As they frequently give pretty steep LIFETIME discounts.
You need to pay up front for em though.
3
u/dotsonjb14 Jun 28 '19
You'd be surprised how much cheaper it is than owning a data center. They aren't meant for small projects like MC servers. People run entire enterprises on it. AWS even built systems like Firecracker just to make their systems cheaper. It's also the reason GCP and Azure are priced the same way. Their feature set is for a particular client.
3
u/midri Jun 28 '19
Spot instances are dirt cheap most the time. Just have to risk occasional interrupt if you're bidding bottom dollar
0
Jun 28 '19
[deleted]
1
u/midri Jun 28 '19
Have not tried launching one myself for a while, but ECS still offers the ability to launch them when you create a new cluster.
1
u/Tyrilean Jun 28 '19
With Amazon, you're paying for the fact that you don't have to hire a team of engineers to maintain your infrastructure. One knowledgeable DevOPS can run an entire company's worth of infrastructure by themselves.
But, the cost savings really only kick in once you're at that scale. For the enthusiast, it's cheaper just to run your own server or get something from Digital Ocean.
1
-20
u/figpetus Jun 28 '19 edited Jun 28 '19
Not that I've double-checked but the author claims:
For up to 20 players you can expect $0.02 per hour the server runs
And says he recommends 10g of mem per player, so 20 * 10 means 200g RAM.
2 cents an hour all day for 31 days = $14.88. Where are you renting a VPS with 200g of RAM for less than that?
EDIT: Goofed the math, it was 10 players per gig of RAM. Still want to know where you can get a VPS wth 2 gigs of ram for less than $15 a month, though.
30
u/rfvgyhn Jun 28 '19
The readme recommends 10 players per GB, not 10GB per player.
17
u/Rekhyt Jun 28 '19
Yeah, any server software that requires 10GB of RAM per user is going nowhere. 1GB per 10 users for something like this doesn't seem incredibly unreasonable
3
2
u/zanotam Jun 29 '19
Pretty sure my Linode is 2gb of ram for 10.00 a month. It might only be 1gb and I'm mistaken, but I'm pretty sure it's 2GB of ram.
2
1
0
Jun 28 '19
[deleted]
27
u/ZEROxSENSE Jun 28 '19
The AWS server shuts down after 15 minutes of inactivity. It reboots the server quite often after shutdowns. Not as functional, but very sustainable for communities. For $15 a month you could host many more people, though the hours it runs would go up as well...
22
u/CalvinTheBold Jun 28 '19
If you want to run an aws instance 24/7, it makes a lot more sense to pay up-front for a reserved instance. A 1 year reservation is $107 instead of the hourly rate. It works out to be about 40% lower than the on-demand price.
12
u/azirale Jun 28 '19
I have done aws for various game servers. I go with spot instances since it is just for friends and it is easy to rebuild from backups on s3, and we generally only play for up to 2 months before moving on.
4
u/Deto Jun 28 '19
You can't start and stop spot instances though, right? So do you save state in s3 then? Every have any issues getting pre-empted?
3
u/azirale Jun 28 '19
You have to terminate.
When I first configure the server I keep the commands to install everything and just re-run on boot, then copy the user data back in from s3 and extract it to the correct locations. Adds a few minutes to startup time
I set cron to do rotating backups, and do it manually before a terminate, so I have data to restore.
I kept the server on except when we knew we wouldn't play for a while. Never had it get taken down, but that was ap-southeast-2
2
u/mogmog Jun 28 '19 edited Jun 28 '19
S3 is a good idea. It's also possible to attach a 2nd game drive that can be reattached to the next instance after termination. Been meaning to give it a try.
Edit: needs to have a ami with steam and things pre installed. Cloudrig.io does this for cloud game streaming
0
Jun 28 '19
[deleted]
4
u/ZEROxSENSE Jun 28 '19
Great question. I believe such a configuration would still work. I haven’t tried it, but unless it interferes with the shell scripts I have running for auto shutdown it should still work. Keep in mind RAM/player would increase as a result of this.
0
Jul 02 '19
[deleted]
1
u/ZEROxSENSE Jul 02 '19
I would follow all of the steps in the readme. The Minecraft server jar needs to be moved onto the instance. Once this occurs, the GUI starts the Minecraft server and should automatically generate a world if one doesn’t already exist.
0
Jul 02 '19
[deleted]
1
u/ZEROxSENSE Jul 02 '19
Do you have a Eula.txt in your directory? You might also have an issue with the java version you installed, cause that varies by AMI. If all else fails I might recommend SSH into the server and see if you can’t manually start the server. In line 50 of server.py could you tell me what command is being executed?
0
Jul 02 '19
[deleted]
1
u/ZEROxSENSE Jul 02 '19
Yeah that sounds about right, I had the same issue when I was building this. I managed to find some git repo that gave me access to a usable java version as I couldn’t get what I needed from apt get.
0
Jul 02 '19
[deleted]
1
u/ZEROxSENSE Jul 03 '19
Wow I certainly hope this IP occurrence you speak of isn’t a thing. I was under the assumption that each instance would have a unique IP, might just have to change the ports for the server to get around that.
0
Jun 28 '19
[deleted]
1
u/ZEROxSENSE Jun 28 '19
Awesome, so glad you got it working!
0
Jun 28 '19
[deleted]
1
u/BddyBrgd Jun 30 '19
I also tried it on a micro and failed. I think there is not enough ram on a micro even for one player. I upgraded to a small and did not have any issues yet
231
u/ATechAdventurer Jun 28 '19
That's a really cool idea, will have to try it out.