TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Almost free serverless on-demand Minecraft server in AWS

431 点作者 ptrik超过 3 年前

26 条评论

stjo超过 3 年前
I wrote effectively the same thing without AWS lambdas <a href="https:&#x2F;&#x2F;playmcnow.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;playmcnow.com&#x2F;</a><p>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.<p>[1] For 15€&#x2F;month you can have ~30 servers running in parallel and thousands of powered down worlds. <a href="https:&#x2F;&#x2F;contabo.com&#x2F;en&#x2F;vps&#x2F;" rel="nofollow">https:&#x2F;&#x2F;contabo.com&#x2F;en&#x2F;vps&#x2F;</a>
评论 #28456927 未加载
评论 #28460079 未加载
评论 #28466669 未加载
评论 #28462237 未加载
评论 #28458172 未加载
评论 #28458998 未加载
angulardragon03超过 3 年前
You can host Minecraft servers for free on Oracle Cloud’s “Always Free” tier [1] now that they’ve added free ARM cores. You get 4 cores and 24GB(!) of RAM to assign to up to 4 VMs - more than enough for a server for friends or family.<p>[1] <a href="https:&#x2F;&#x2F;www.oracle.com&#x2F;cloud&#x2F;free&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.oracle.com&#x2F;cloud&#x2F;free&#x2F;</a>
评论 #28455508 未加载
评论 #28461312 未加载
评论 #28456389 未加载
评论 #28456286 未加载
评论 #28456016 未加载
评论 #28455666 未加载
评论 #28456151 未加载
评论 #28455525 未加载
015a超过 3 年前
&gt; The DNS lookup query is logged in Route 53 on our public hosted zone. &gt; CloudWatch forwards the query to a Lambda function. &gt; The Lambda function modifies an existing ECS Fargate service to a desired task count of 1.<p>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.<p>&gt; Fargate launches two containers, Minecraft and a watchdog<p>I&#x27;d love to see a cost analysis between running the &quot;watchdog&quot; as a Fargate container versus another lambda function. Even having a lambda function run once every 5 minutes 24&#x2F;7 would trigger ~15,000 invocations a month, which is in the realm of &quot;near Free&quot;.<p>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.<p>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.
评论 #28463699 未加载
300bps超过 3 年前
I always say the best way to learn a new technology is to work on a real-world project that you are interested in.<p>The person that set this up got an amazing education on use of real-world AWS services.<p>A lot of IT people aren&#x27;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&#x27;s more about architecting solutions so that resources pop into existence for the exact # of milliseconds they&#x27;re needed and then they&#x27;re released. This is a clever step along that path.
评论 #28456279 未加载
tlarkworthy超过 3 年前
I made a service like this on Observable<p><a href="https:&#x2F;&#x2F;observablehq.com&#x2F;@tomlarkworthy&#x2F;minecraft-servers-be" rel="nofollow">https:&#x2F;&#x2F;observablehq.com&#x2F;@tomlarkworthy&#x2F;minecraft-servers-be</a><p>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.<p>It was based on the following terraform recipe (which I wrote)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;futurice&#x2F;terraform-examples&#x2F;blob&#x2F;master&#x2F;google_cloud&#x2F;minecraft&#x2F;main.tf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;futurice&#x2F;terraform-examples&#x2F;blob&#x2F;master&#x2F;g...</a>
academia_hack超过 3 年前
This is awesome! I&#x27;m still afraid that one of my friends will go on a Minecraft binge (or idle in a farm) and drive up the costs beyond the $13&#x2F;month or so I pay for VPS hosting but I think this approach would objectively be quite a bit cheaper for the casual vanilla SMP server I run for a dozen or so folks. Anyone know how to estimate the &quot;worst case&quot; monthly cost for this config?<p>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&#x2F;hrs per day rather than the full 24.
评论 #28455874 未加载
评论 #28460347 未加载
评论 #28455292 未加载
bussierem超过 3 年前
I&#x27;ve seen one offhand comment about this so far from someone else, scrolling through the comments here. Wanted to make it a top-level comment though:<p>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!
评论 #28462602 未加载
vultour超过 3 年前
I ran Minecraft on spot instances when we used to play in university, complete with automatic terraform+ansible provisioning and automatic saves&#x2F;backups in S3. Never used Fargate but I doubt it can beat spot instance pricing. More than half my bill was network traffic.
评论 #28455448 未加载
评论 #28455439 未加载
endgame超过 3 年前
Another take on this is to intercept the login message and use that as the trigger: <a href="https:&#x2F;&#x2F;github.com&#x2F;infinisil&#x2F;on-demand-minecraft" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;infinisil&#x2F;on-demand-minecraft</a>
评论 #28456283 未加载
meekins超过 3 年前
To me a DNS lookup spinning up a container on Fargate looks both very cool and scary at the same time.
评论 #28460048 未加载
评论 #28456780 未加载
shog_hn超过 3 年前
I&#x27;ve got a Minecraft server running in AWS with a graviton &#x2F; ARM spot instance + EFS for persistence. It&#x27;s also cheap to run (I run mine 24&#x2F;7 and it hosts multiple other services as docker containers). Cost ~$10 per month. Infrastructure deployed with aws-cdk<p><a href="https:&#x2F;&#x2F;www.shogan.co.uk&#x2F;gaming&#x2F;cheap-minecraft-server-in-aws-with-docker-and-traefik&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.shogan.co.uk&#x2F;gaming&#x2F;cheap-minecraft-server-in-aw...</a>
7ewis超过 3 年前
Have you found that any web crawlers have tried accessing your subdomain?<p>Wondering if services like Google or Shodan may have tried querying it and causing your server to turn on?
评论 #28461374 未加载
评论 #28455675 未加载
aweiland超过 3 年前
Instead of Twilio you could use SNS and subscribe to it via SMS. You would most likely stay within the free tier there too.
评论 #28461321 未加载
simonw超过 3 年前
This is a really smart setup, and superbly documented.<p>I just wish there weren&#x27;t so many steps to get this kind of thing running! Even with automation it&#x27;s still a LOT - getting this running myself would take me a few hours, and I have prior relevant experience.<p>A regular non-software-industry-professional parent has little chance.<p>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.
评论 #28461653 未加载
jonnycomputer超过 3 年前
What is a serverless server?
评论 #28456756 未加载
评论 #28459503 未加载
flatiron超过 3 年前
For all that work why wouldn’t they just use a droplet for $5 a month?
评论 #28455486 未加载
评论 #28456189 未加载
评论 #28460169 未加载
评论 #28456294 未加载
评论 #28477686 未加载
评论 #28455512 未加载
ylyn超过 3 年前
This is so complicated.<p>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.<p>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.
评论 #28461497 未加载
TheDudeMan超过 3 年前
&quot;ECS Fargate service to a desired task count of 1&quot;<p>This qualifies as &quot;serverless&quot; now?
评论 #28460127 未加载
bingohbangoh超过 3 年前
Gotta say, I never had good luck with AWS Lambda Serverless. Blew through the free quota playing around with a django app deployed using Zappa. Never got out of the &quot;let me make sure this works when deployed&quot; phase.
l30n4da5超过 3 年前
Id rather just host a minecraft server on an old desktop, and make it internet-available with playit.gg.<p>A lot less chance of me spending $$ that way.
评论 #28458716 未加载
评论 #28456834 未加载
pkilgore超过 3 年前
Glad someone finished this. I got 90% of the way there using a lambda to find spot instances but got too busy to finish.
soobrosa超过 3 年前
I&#x27;m like why all this overengineering instead of deploying on a cheap EC2 like to be used _all the time_.
mt_超过 3 年前
The only thing missing is an IaC definition of this architecture.
stiltzkin超过 3 年前
I would love to see this for Valheim.
评论 #28459703 未加载
Aissen超过 3 年前
<p><pre><code> 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? </code></pre> It&#x27;s 2021 and the biggest cloud platforms still don&#x27;t have hard limits on spending.
评论 #28456006 未加载
评论 #28456081 未加载
评论 #28456771 未加载
评论 #28455997 未加载
评论 #28456147 未加载
评论 #28456032 未加载
评论 #28456101 未加载
评论 #28458670 未加载
评论 #28456074 未加载
评论 #28458798 未加载
评论 #28456181 未加载
评论 #28456736 未加载
评论 #28456733 未加载
评论 #28458296 未加载
评论 #28458751 未加载
unnouinceput超过 3 年前
Lately word &quot;serverless&quot; is used freely on HN. Want a clickbait title? use &quot;serverless&quot;, damn be that only 4 words later &quot;server&quot; is used too
评论 #28456488 未加载
评论 #28456421 未加载