by Mengkudulangsat · 6y ago · 0 comments
I've been reading a lot about tiny websites on HN (e.g. https://bearblog.dev). Can we use these Raspberry Pis to host them? Are they performant enough? Is setting things up newbie-friendly?
Having your own little corner on the internet that no one can shut down sounds pretty cool.
As for setting things up, if you can apt-get install apache on any generic Linux box, you can do it on a Raspberry Pi.
The website is https://www.piwheels.org - it's a Python package repository for Raspberry Pi users
It's served over 20M downloads, which is 70TB. Currently serving 1.2M downloads a month (4.4TB).
A cheap VPS would be easier, better and about the same price. But piwheels is a bit of a dogfooding project. But it works!
Eventually I moved my sites to a VPS out of convenience. My ISP can't guarantee a static address with my current plan (although I've found it is static in practice so far), and the additional cost of a plan where they can exceeds the cost of renting a VPS.
If you have an ever changing dynamic IP allocation, you can still use Dynamic DNS services to update DNS records. I use GoDaddy for my names and AFAIR they provide this service, but there are also free providers that'll give you a subdomain, like https://dyndns.org. This requires some additional setup, because you need to update your IP with the dynamic DNS API regularly, for example via a cron job.
As for setup, if all you need is static pages you can use Raspbian and just install Apache or Nginx, put your files under /var/www/html and on your router forward some port to port 80 on your Raspberry Pi.
If your DNS provider has a CLI just use that. I use Route53 and a simple cronjob to update it.
Nginx? Apache? Cloudflare?
Would be nice if the Raspberry Pi kit comes with IKEA-level instructions to do this as weekend project.
I think another limiting factor to look at is your upload bandwith. If it's too low, then it will saturate and your conection will be very slow. Some ISP provide asymetric bandwith (much higher download than upload), so that's not the best case. If you have fiber, then you're absolutely good to go.
If your blog is featured on HN first-page, then it certainly won't handle the load with a RPI. But for most blogs, it should be enough.
Running ab on the Pi itself, the CPUs can deliver over 3k rps though of course the network subsystem is an important part of the story.
But if you want to learn about hosting (web servers, static routing, linux), then DIY. Using at least 2 GB RAM makes life easier.
His name was Boris and he was the company’s MVP for several years running :)
1. What was the highest uptime Boris pulled off?
2. Why did you have to decommission him? Was there an eventual hardware failure?
Thanks!
Sitting behind a free CloudFlare account mitigates a lot of bandwidth usage too.