Ask HN: Why can't my old laptop be an AWS replacement?
I have two old macbook pros with 8vcpu's and 16 GB of ram each. A comparable computer on AWS would be approximately $100 a month. Why isn't there an easy way to utilize my unused hardware for my production servers (if not for mission-critical stuff, perhaps just for background jobs)?
Any counter / pro arguments are welcome.
70 comments
[ 3.1 ms ] story [ 114 ms ] threadIt's not that difficult if you know some Linux and router configuration. Most of the time the difficult part will be exposing your computer to the Internet as you probably don't have a fixed IP
I have $5/month VPS which I use for this reason though my home IP address is static. My use case is simply for messing around and nothing that has to be up and running 24/7. Power outage/flicker has been the biggest issue for me.
Using AWS will give you a static IP, but if you ask me that's a little overkill if your purpose is only for getting a static IP. If you have a domain name some registrars like Namecheap offers DDNS service for free. Or you could just use a free service like no-ip or DuckDNS
I have an ultra cheap VPS instance that I run wireguard on, and expose these servers to the internet through there. The Mini-PCs are like NUCs, so they hardly consume much power, and I have paid less than 6 months worth of comparable AWS costs to own and run them till now.
The two biggest issues I have are power backup - UPS works for only 3-4 hours, after which the servers shut down, and internet connections - I have 2 100Mbps fiber lines load balanced, but the reliability of consumer internet leaves things to be desired.
I spend roughly 2-3 hours every other month to maintain the whole thing, which is pretty much hands-off. I'd say it's been totally worth it for me, but I still use AWS for mostly S3 and SES.
Connectivity, you're likely right about. But for reliability... that's probably not accurate.
Most laptops (with stable software) don't seem to show any issues when running for months at a time. And they have built-in battery backup too. :)
Depending on the battery life for those old macbook pro's, that battery backup might last many hours. As servers, they don't need to run with their screens on. :)
Maybe not as important for homelab style things though.
The probability of a bit errors is not low, and if you keep data for a decade, it gets bad
https://electronics.stackexchange.com/questions/497044/what-...
To me, those should be two different categories.
* Homelab -> experimentation
* "My life's photos" -> production
But I guess that's just arguing over semantics at this point. :)
I've joined r/homelab based on your suggestion. I love their content. Thank you for the suggestion and your response.
You've got availability concerns (power, network, hardware failure, etc), the networking to get a static IP in the place the laptop lives might be a bit tricky, but you can absolutely do this.
There are times I long for the simpler approach from the "old-timey" days, but I digress...
> You've got availability concerns (power, network, hardware failure, etc), the networking to get a static IP in the place the laptop lives might be a bit tricky, but you can absolutely do this.
Availability is a good point :), static IP too. Thanks for the thoughts.
If you use VMs, you have to update and maintain the hypervisor. You update it and it may break. You need to take care of networking, firewalls, snapshoting, etc. If you use AWS, there is a lot of external services available, eg, add block storage as needed, create a S3 bucket and connect it, etc. Static IP address is another good thing.
I use LUKS on baremetal, and even some virtual servers, without much issues. The setup is a bit more complex than average though.
If you already know how to run the desired workloads on the laptops, then most of what remains is a way to make it accessible to the rest of your infrastructure. Cloudflared, nebula, or wireguard tunnels are a few options.
I use nebula (https://github.com/slackhq/nebula) to network all the machines of my homelab, regardless of how they're connected to the internet, including my laptops. I do think there's space for more lightweight and batteries-included options to take advantage of connected resources in this model.
IPV6 works, so long as you have a jump box to get you from a CGNAT'ed IPV4 network into the global IPV6 world.
If you want to skip on the jump box, you could give up some convenience and go with TOR to get yourself back to your home-AWS setup.
I would say this is the biggest barrier to utilizing home compute.
As for reliability, you could use just program stuff to dependency failure rates of 5% (up time of 95%).
I would not run any Docker containers or Kubernetes as that will be too much work. I would stick to bare metal and not bother with isolation. Just make sure you are using certificate authentication or SSH. Do not use a user name and password or expected to be pwned.
Lastly, I would definitely consider using gitlab.com to host code and run a gitlab runner from home. The previous parts of what I wrote become moot. The runner just connects when it can and runs jobs.
I would certainly default to bare metal, likely a simple go binary running as a Job side-runner for a main prod server hosted in the cloud.
> Lastly, I would definitely consider using gitlab.com to host code and run a gitlab runner from home. The previous parts of what I wrote become moot. The runner just connects when it can and runs jobs.
Gitlab runner looks promising, though I am not sure if it's intended for work outside the git workflow.
Thank you for your thoughts.
The unfortunate reality, at least in Australia, is that fast internet with the same level of uptime as what you'd get in a datacenter costs more than just renting a server on Digital Ocean.
Perhaps there's a market out there for small cloud providers who could amortise this expensive internet cost among dozens or hundreds of servers, but for a one-off you're either going to need to deal with the unreliability and low upload speeds of home internet or just cough at the trough to get a cloud instance.
The main downside is lack of remote controls. If it craps out, I can't remotely reset it.
I do what you are describing for fun, but I would never recommend it for a business, even if it is reliable.
To get around the reliability problems, I have the on-prem laptop environment update cloudflare entries with keep-alive timestamp messages. .. I then have a Google script that monitors the keepalive and if too much time has passed, a “failover” is done and everything that was running on-prem is spun up in digital ocean. The failover script completes by updating DNS and pointing to DO
I don’t allow the system to fail-back, I always investigate every time there is a failover, but it rarely happens and is usually due to power outages.
I appreciate your response and don't necessarily disagree. Could you tell me a little more about why you wouldn't recommend it for a business, even if it is reliable?
> To get around the reliability problems, I have the on-prem laptop environment update cloudflare entries with keep-alive timestamp messages. .. I then have a Google script that monitors the keepalive and if too much time has passed, a “failover” is done and everything that was running on-prem is spun up in digital ocean. The failover script completes by updating DNS and pointing to DO
This is a clever solution. Thank you for your thoughts!
If you’re able to document the setup properly and have multiple people that have intimate knowledge of your machinations.. then you are covered .. unfortunately most people do not cover these bases.
If you have built yourself into this process you will realize quickly that nobody else understands it, and you will have a hard time taking vacation (among other things)
Also you put the business at risk because you need to plan for what the company will do when you get hit by a bus.
For these reasons it’s generally more preferable to pay a premium to go with a standard solution as opposed to something you cobbled together to save small amounts of money.
This is why I self host, gaining knowledge is a pro not a con.
self-hosting for a business is RARELY sane :)
- Get a static IP from your ISP
- Point the DNS record at the static IP
- On the server run NGINX + Gunicorn + Django
That setup will have >99.5% uptime and handle 1000 - 10,000 concurrent users, depending on the complexity of the website.
Unfortunately easier said than done. Many of the major ISPs, like Comcast, don’t offer them to residential customers. And some ISPs (like mine, in the past) won’t do business service to some residential buildings.
Fortunately there are dynamic DNS services that help with this problem.
A dynamic DNS service might be cheaper tho.
I've also got 10G fiber with them, and at least this time the IP didn't change after they updated the firmware on their garbage ONT. XG(S?)-PON stuff is still real immature.
In Germany most ISPs don't even give you a dynamic IPv4, it's cgnat so you share with a lot of other people.
But there are ways around it. I use Cloudflare Tunnel and that way I don't expose anything (I could only do it with ipv6 but in the end Cloudflare Tunnels are easier)
Now you can run your homeserver even from a hotspot, if needed.
Back in the day I ran a bunch of sites off of spare equipment. Now my expectations are higher. But for backend stuff it's be fine, just design with failure in mind.
That said here is an incomplete list of things in the greater system that self-hosters frequently need to think about, and that AWS sometimes does a good job of handling for you:
- Routing/DNS/Static IP
- Administrative access control
- Firewall
- Load balancing
- Redundant storage
- Server failover
- Power redundancy
- Network redundancy
In particular, some of these things benefit a lot more from economies of scale than the server hosting itself.
this is essentially what the "hybrid cloud" approach is: you have some things in the cloud and some other things in a physical datacenter where you have your own machines.
there are some issues and limitations that you'll find though:
and probably something more that i'm forgetting.as long as you're fine with the tradeoff, you can definitely do that.
It turned out that in actual tests, the laptops were several times as reliable as actual server-class PCs, much cheaper, and came with built-in UPS. Server hardware is a racket, and if you have any redundancy at all built into your system, not really needed or desirable. I've used redundant/clustered laptops or netbooks as servers in quite a few projects since then - they're just better than server-class hardware most of the time.
But they might not be silent enough to not disturb you when sleeping.
Another con is that they aren’t rackmountable. So if you want to stack them you need to use some non-standard solution for that. And if a HDD/SSD fails, you need to order a replacement yourself, etc etc.
It’s totally doable. But is it worth the hassle? That’s up to you.
Agree 100%.
> Another con is that they aren’t rackmountable. So if you want to stack them you need to use some non-standard solution for that. And if a HDD/SSD fails, you need to order a replacement yourself, etc etc.
> It’s totally doable. But is it worth the hassle? That’s up to you.
Thanks for your unique take. HDD / SDD failing is definitely worth considering if it's worth the hassle. +1
You can even run localstack on both machines to have mocks of AWS services that you can use the AWS CLI against.
You can even run Kubernetes on your nodes and run whatever you need on them. Plenty of folks do that; check out the homelab scene.
I personally don't because it costs me $5/mo to run several "serverless" functions via API gateways that communicate through message queues, some on a schedule, host some websites with globally-accessible DNS records and hold a ton of backups for stuff I care about, without me having to do a ton of systems administration to keep the lights on.
(Most of the cost is DNS, actually! Everything else falls within free tier limits. Genius move on AWS's part, as I know AWS well and have recommended it to several large companies; they've made their money from me for sure)
I did that back in the day (ran my own email server). I'd rather do other things with my time now.
There are lots of easy ways to do it. It would take less than an hour to setup depending on how you wanted to configure it (longer if you were going to colo it).
Managing your own hardware does come with tradeoffs though. If it's not already clear how to do this the tradeoffs may not be very pleasant.
With AWS or other cloud providers you're in large part paying for convenience (as well as reliability and a few other odds and ends).
If you don't mind a learning experience though, there is nothing wrong with using them this way. Understand it will be a learning experience though, probably with associated downtime as you learn.