Hacker News new | ask | show | jobs
Ask HN: Why can't my old laptop be an AWS replacement?
64 points by grocketeer 1079 days ago
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.

27 comments

They'd be adequate at running a bunch of services, but cannot bring the connectivity and reliability that AWS provides. I myself have been running a bunch of Chinese Mini-PCs to the same effect since last few years now, and found Reddit Homelab community to be a source of inspiration.

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.

> ... cannot bring the connectivity and reliability that AWS provides.

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. :)

ECC Ram is important, and most laptops don't have it. Just because you don't see bit errors doesn't mean it doesn't happens. Specially in a 16gb of RAM laptop, that thing is pretty much sensible.
That's a good point, for oriented production stuff especially.

Maybe not as important for homelab style things though.

Even homelab, I keep my life's photos in a Nas and a single bit flip can make any picture unreadable.

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-...

> Even homelab > I keep my life's photos ...

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. :)

This is good to know. Thank you for the reference
Well, I have found that it changes with numbers and age of the device. Generally speaking, you are right though.
Most laptops end up in the trash because of the case, keyboards, etc. If you keep it headless why not.
> ... found Reddit Homelab community to be a source of inspiration.

I've joined r/homelab based on your suggestion. I love their content. Thank you for the suggestion and your response.

If you're a little less ambitious (as I am), /r/minilab is also a nice place.
Thanks!
It is easy. In the olden days it was the only way.

- 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.

> Get a static IP from your ISP

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.

I’ve got a static IP it’s doable.

A dynamic DNS service might be cheaper tho.

This just totally depends on your country and ISP.

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)

I've got a static IP (v4) too. Used to be Sonic would offer your four IPs for free. Now it's down to one, and only if you're in an area not served by their fiber service. They've backed away almost immediately from the idea of offering static IPs to their fiber customers and I'm pretty sure they don't do IPv6 with fiber either. And Sonic supposed to one of the better web providers out there.

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.

To agree with your point, I just looked this for my ISP (Telstra, Australia), and it seems it costs $10/mo to do this. It's not much, but consider that a VPS is likely to cost me less than even that.
Afraid.org is pretty old but has offered free dynamic dns for awhile and works great
Thanks!
Or use tailscale?
There's services which provide a dynamic DNS by having the host ping the DNS provider periodically to update the A records with the new IP automatically. Used to do that with a minecraft server
Just get the cheapest VPS you can find and slap OpenVPN/Wireguard there.

Now you can run your homeserver even from a hotspot, if needed.

You can totally do that.

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.

If you're just talking about this as an alternative to renting metal in EC2, it's probably worth acknowledging why that exists in the first place. Bare metal server hosting doesn't exist to provide some unique functionality. It's outsourcing server maintenance. It's an answer to the question: "why can't we just pay somebody else to keep this server available for us?". If you don't want to outsource that task, you're not fundamentally missing out on anything by not using it.

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.

My PC under desk have better uptime that us-east-1. What is really required to run the own datacenter is static IP and Linux knowledge.
I love your take! haha
You can do whatever you want it’s all a question of your tolerance for risk and the complexity of the environment you want to maintain.

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 do what you are describing for fun, but I would never recommend it for a business, even if it is reliable.

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!

Yes, I wouldn’t recommend it for a business just due to the complexity of the setup and the necessary knowledge to keep it running.

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.

> and the necessary knowledge to keep it running.

This is why I self host, gaining knowledge is a pro not a con.

self-hosting for yourself can be a sane decision

self-hosting for a business is RARELY sane :)

You can just install Linux on them and put them in your wardrobe.

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.

> You can just install Linux on them and put them in your wardrobe. But they might not be silent enough to not disturb you when sleeping.

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

I may be missing something really obvious as everyone keeps being up LUKS…. Why would I want to use it for what I described above?
I have some thoughts about that. Feel free to shoot me an email. (On vacation currently, might be very slow to reply.)
One issue is uptime. Sometimes the power goes off and you need a ups. If you have LUKS enabled, you need to be physically near the server to restart it.

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.

You can configure your servers to start a small SSH server at boot to receive the LUKS keys remotely.

I use LUKS on baremetal, and even some virtual servers, without much issues. The setup is a bit more complex than average though.

I mean, it is. There's a bunch of little details to get right, but it is. You're paying Amazon for the pleasure of not having to deal with those details, but those details are just life. My power's out so my website's down? That's fine for my website. I'm not running Google.com here. It's just my lil personal site.

technology has, and hasn't advanced. there's wordpress and php and the world is still the same.

You can build all that stuff, from scratch. Go to best buy, build a computer, set it up at home, get another computer for redundancy, get another ISP for backup then get a battery backup in case the power goes out. The pieces are there, it's all available to you.

If you're just discovering now, that you can do for free what someone else is charging you money for, then you're one of today's lucky 10,000. https://xkcd.com/1053/

Man I love xkcd. Lol, maybe I am one of today's luck 10k!
Part of what you're paying for with the AWS instance is "easy", documented integration with the rest of the AWS ecosystem, including things like access control and monitoring.

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.

I'm curious what does nebula offer that a VPN doesn't?
I've thought the exact same thing recently, after getting some mini PCs from a mate who does used IT equipment for dirt cheap.

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.

I put esxi on my old 5,1 that had 64gb of ram and used it for a test hadoop cluster. I also had like 8 macpro 1,1 and 3,1s as nodes. Now i use an old thinkcenter with 128gb or 192g. of ram as my main testbed.

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.

i use some older Lenovo ThinkCentre Tiny for my homelab. at some point they ran openstack. now they run containers. so yeah, you can
Yes, but you need a static ip address, resilient server software components, acceptance of occasional inconvenience.

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'm running a few projects from my home on a 10 year old dual core laptop with 16gb of ram. I run docker swarm with nginx for static stuff, 2 nodejs/react apps, a python app, a few sheduled jobs, a mongodb and a postgres db, victoriametrics + grafana for monitoring, portainer for docker management and a few other things. In total 18 running containers I use cloudflare tunel to expose them to the internet. here's an uptime: 07:26:00 up 89 days, 15:50, 3 users, load average: 1.03, 1.15, 1.21 Sure, the apps don't do heavy computation, just normal stuff but i found it enough. Even faster than some aws containers that I use at work.
Networking would definitely be a concern and I 100% agree that programming for higher failure rates is a must.

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.

You can do a POST with an api access token to gitlab.com to get a job to run with custom environmental variable settings. So, you don’t have to use git to start a job.
> Why isn't there an easy way to utilize my unused hardware for my production servers

It'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

Would reverse SSH-ing from the laptops to a VPS with a static IP solve this problem? It sounds like OP would still be using AWS so he could set up a permanent IP there and then reverse SSH.

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.

Interesting... This is actually the first time I heard of reverse SSH. But if my understanding is correct then it should solve the problem theoretically.

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

Yes it might, though I wasn’t aware that SSH sessions ought to / are capable of living for long periods of time.
> Why isn't there an easy way to utilize my unused hardware for my production servers

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.

Running our services on computers is exactly what we as an industry did in the old-timey days.

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.

> Running our services on computers is exactly what we as an industry did in the old-timey days.

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.

I'm aware of k3's, thank you for the suggestion
I do a similar thing with my desktop. When I'm travelling, I switch on Hamachi before I leave. That way, I can access it (and the various services I run on it) remotely.

The main downside is lack of remote controls. If it craps out, I can't remotely reset it.

You can absolutely do this for your CI if it allows self-hosted instances. For production as others pointed out, you need connectivity and reliability when something goes down at 3am (power, internet, disk failure).
It can be. Or you could use a Mac Mini which is suitable for this. And I don't think it is particular hard configuring your local network and getting a static ip from your ISP.
You can alway setup a kafka or message queue consumer on these sort of hardware. I'm testing my RTX card for some offloading of free-tier volume as well
You can do that, sure, but the point of AWS is how easy you can expand. If you don't need that elasticity a laptop can totally work as a server
Resilience is going to be a big factor here. Laptops are built assuming they wont be used as a dedicated server.
I once built a system on laptops for use in critical on-site oil spill response operations (so billions plus environmental damage at stake if it doesn't work.) We used laptops because we needed the portability, so even the critical servers were running on laptops.

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.

It can, but it doesn't work with autoscaling. If you have something that scales, you can probably work it into the architecture, similar to spot instances, but spot instances should be much cheaper than the standard cost.
you can. create a vpn connection to your aws vpc (either via some custom solution or a managed one), install and configure your laptops and there you go.

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:

    - networking (bandwidth & latency)
    - OS updates and security
    - reliability (power outages)
    - thermals & cooling
and probably something more that i'm forgetting.

as long as you're fine with the tradeoff, you can definitely do that.

Here is a quick one: old MacBooks run modern Linux just fine. You can run something like Proxmox on both and you suddenly have room for a few virtual machines running whatever you like.
Dynamic IPs and uptime