Live data from Hacker News

Serving a website on a Raspberry Pi Zero running in RAM

btxx.org

21–30 of 107 posts

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

#21
I've been using Raspberry Pi Zeros for cheap little linux appliances since they were released. Boot them up with the latest Alpine Linux and run the whole thing from ram. You can also remove a card from a running machine with no ill affect, and they easily survive power cuts. I've never had a card fail.

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

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

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

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

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

I wouldn’t consider “the way most people do TLS in 2026” weird. That said this isn’t all that impressive or interesting, a computer… serving a website.

Is sending plaintext traffic over the open Internet "the way most people do TLS in 2026"? Am I missing something from the post?

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

#25
post #13

Earlier quoted context omitted.

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.

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

You can host such sites perfectly well nowadays. I’ve often served hand-written HTML pages of only few lines

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

#26
post #12
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.

Yeah, I've seen this in more than a few places. There was a blog "running on a Wii" that, IIRC, was doing the same thing. On the one hand I get it, TLS is pretty heavy, and it makes sense to take advantage of a VPS or Cloudflare or however you want to do it. But once you are spinning up a VPS, the question is ... why the Pi? The VPS in the article has less RAM, but more storage. If you're already doing TLS terminatio…

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

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

#28
post #13

Earlier quoted context omitted.

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.

>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 hundreds of downloads for a single web page is up to the constructor of that page. Still, these things can be reasonably cached. For example, host it on the Pi, then put a cloudflare in front of it or something.

The Pi Zero might not be for you, or easy to try to undermine. Which criticisms would go away if it was on a regular pi?

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

#29

The pi zero's are great. I have a bunch of them. I used to use them as a tiny server for live webcams streaming to YouTube for customers, but YouTube now have a minimum sub count before you can go live, which sucks. These boards are pretty powerful.

I have never been able to stream video from a raspberry pi zero's official camera. What tools/software were you using?

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

#30

Earlier quoted context omitted.

I wouldn’t consider “the way most people do TLS in 2026” weird. That said this isn’t all that impressive or interesting, a computer… serving a website.

Is sending plaintext traffic over the open Internet "the way most people do TLS in 2026"? Am I missing something from the post?

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 hosting and doing php on the same server, it's not the typical approach for any custom software at this point.

Post reply on HN