Live data from Hacker News

Serving a website on a Raspberry Pi Zero running in RAM

btxx.org

71–80 of 107 posts

Re: Serving a website on a Raspberry Pi Zero running in RAM

#71

Earlier quoted context omitted.

Yeah, I ran a phpbb forum (alongside my normal static site) on a 486 in 2003 or so. It worked. It was slow, but it worked just fine for my friends and I! I remember it took multiple minutes to generate the SSH server key after the initial install lol

A 486 in 2003? Pentiums were shipping by the mid-90s, did you just have super old hardware lying around? I retired my 486 in ‘95 or thereabouts…

In the mid-90s, I retired my 486 hardware and brought it over to a local ISP that we were friends with.

It had a second life doing stuff like delivering mail, handling IRC, serving web pages, and whatever else a few of us wanted from it. The performance was fine.

(The Pentium-ish machines stayed on desktop duty where GUIs devoured resources.)

Re: Serving a website on a Raspberry Pi Zero running in RAM

#72
post #5

Earlier quoted context omitted.

I hosted my personal email domain on a Zero for almost 10 years. It had about the same capability as the very expensive (and large) Win NT4 machine we used for our 80-person organization when I started my career in tech. I eventually replaced the Zero with a Raspberry Pi 4, primarily because the Zero’s IO ports are annoying (eg, USB is not hot-pluggable!) An RPi 4 is extreme overkill for personal email but it still i…

>The point of failure for all of these machines has been the SD card. They seem to last 4 years almost to the day. I suppose if I set up a RAMdisk they might last longer, but honestly, for the price of an SD card it’s not really worth my time. There are "Industrial" SD cards which should last considerably longer, you can look up a few people have done their own testing. They can be slower but that shouldn't be a bloc…

You can also boot (full size, not-zero) pis off USB disks. Or just netboot.

Re: Serving a website on a Raspberry Pi Zero running in RAM

#74

Earlier quoted context omitted.

The TLS termination isn't actually on the VPS. The article details that Tierhive has an haproxy edge service (handling the TLS), that then has the vps as the backend, but that vps is just doing tcp proxying with socat to the ddns exposed home server fqdn. Feels like a lot of unnecessary loops. Kinda fun I guess but, just, why

Yes it is, "we plan to use our external VPS for handling the TLS termination". Edit: Ah I see you are just pointing out termination is on haproxy service not VPS. Thought you were implying it was terminating on pi, my apologies.

But it's plain text like you said in another comment after the haproxy, so two more plain text paths (with at least one going through the internet (vps->pi), not sure if haproxy->VPS is internal to the provider network (maybe)), so not ideal in my book

Re: Serving a website on a Raspberry Pi Zero running in RAM

#75

Earlier quoted context omitted.

Many (most?) are hosting web applications and/or content in separate applications and sometimes servers from where TLS (HTTPS) termination happens. HAProxy, Traefik, Caddy and Nginx as reverse proxy and TLS termination servers are pretty common, even more so if you're containerizing your applications themselves. It dramatically simplifies the application stack. While I may make the argument that most are probably hos…

It's vastly different to do TLS termination within your own network and to do it on a rando VPS and then send normal TCP over the internet. It's not an argument of it being on the same server.

The VPS is your security in this case. It's not sending plaintext over the internet, is it?

Edit: No, the article mentions listening on port 80 at home. I thought they'd be SSH tunneling or something. That is unusual, but I guess for a static website it doesn't really matter.

Re: Serving a website on a Raspberry Pi Zero running in RAM

#77
post #13
post #8

This feels a little weird because while they are running the website itself (HTTP) off the Pi, they are handing off all TLS to a cloud provider. So while the content is in RAM on the Pi, a lot of the heavier lifting (TLS termination) is done elsewhere, which saves a ton of CPU load on the Pi.

It is more than a little weird. A pi zero is more than capable of handling HTTP/1.2 and TLS 1.3 for a handful of connections per second. This machine is 10x what we were running web servers on in the '90s. Also, all web pages are served from RAM. It's automatic that modern OSes will cache this stuff on first access.

[deleted]

Re: Serving a website on a Raspberry Pi Zero running in RAM

#78
post #28

Earlier quoted context omitted.

>This machine is 10x what we were running web servers on in the '90s. Kind of irrelevant since operating systems and web pages in the 90's were significantly smaller in footprints, as the web was mostly plain text back then. Windows XP with its GUI would run Max Payne on 128MB of RAM. You could do a lot more back then that You can't do modern stuff like that today with 128MB of RAM.

The contents of webpages are largely the same. HTML code, CSS, Javascript, Images. In this case, they are static elements, which can even be cached locally to share more easily. If someone wants a massive build system to render a static HTML page, that's on them, and their personal interpretation. Increasingly, and maybe more often than not, there is more than one way to get the same outcome. The fact that there's hu…

>Which criticisms would go away if it was on a regular pi?

Maybe you misunderstood. Which criticism did I make of the pi zero? I criticized present day SW.

Re: Serving a website on a Raspberry Pi Zero running in RAM

#79

PiZero is a pretty solid machine. I run my micro-homelab on a Pi Zero from 2018. It’s behind Cloudflare tunnels. It runs the apps i need on a DietPi OS within 180MB and it’s uptime is ~8 months.

First time I hear about DietPi OS, does it offer a headless distro?
Post reply on HN