Hosting Discourse on a Raspberry Pi?

In my opinion you are better off waiting for the eventual Raspberry Pi 5, which – if you graph forward the progress in Pi performance from 2, to 3, to 4 – should have enough oomph to run Discourse.

I’m not sure the x86 (x64?) dependencies are surmountable at the moment, either, but not a bad idea to look at that for longer term.

1 Like

A cluster of Pi 4 with the 64-bit quad core 1,5Ghz and possibly USB3 disks for storage (~300MB/s) or external blob store (S3 or GCP) and a CDN in front of those anonymous users must be a possible platform alternative :slight_smile: Future will tell!

1 Like

That’s not really a meaningful number on its own.

You didn’t specify which microSD card that was, but it’s in the same order of magnitude as a Lexar Professional 1800x, which can sustain sequential read speeds of ~300MB/s and writes approaching 250MB/s. Sequential reads and writes aren’t the problem with microSD though, you need to look at random reads/writes to get a real feel for what’s going to be happening with multiple users hitting the database and local assets.

Modern SSDs usually fall in the region of 500MB/s+ sequential reads and 475Mb/s+ sequential writes - which isn’t too far off the numbers above. The performance delta on random reads/write though is huge - the same SSD will pull up too 400MB/s on a 4KiBQ8T8 while the Lexar drops to low double-digits, at 15MB/s or thereabouts. Random writes are even worse, with SSD still sustaining as much as 300MB/s while a microSD gets nailed well into low single digits (2MB/s).

I’m a big fan of rPi, and use them in a bunch of places, but they’re still a long way from where we need them to be.

1 Like

It’s a USD $20 (in Sweden) sandisk 64GB card, rated A2 I believe. Just wanted to prove the pure sequential speed is not as bad as you made it sound :slight_smile:

If it doesn’t work on the rPi even with external SSD on the USB3 ports, I’d assume running the database externally would fix that particular bottleneck. But I’m biased as I like the idea of getting an arm cluster up and running with the now real 1GBit/s NICs on Pi 4. I also like to challenge “it doesn’t work” mentality in general :wink:

1 Like

If you throw enough time, money and resources at anything you can make it work.

Requests to run Discourse on a Raspberry Pi over the past few years typically originate from users who have a Pi, and don’t want to spend anything beyond that. That’s effectively what we’re exploring here.

The moment you start bolting on external SSDs and offloading the database to a different system you aren’t really talking about hosting Discourse on a Raspberry Pi at all. :wink:

1 Like

Right. I agree you still usually get what you pay for :slightly_smiling_face:

take a Raspberry PI 4 ram4 or ram8 :wink: then take one MicroSD (INDUSTRIAL) up Amazzon… Ebay…
write on Docker dal sito: https://blog.hypriot.com/ :smiling_face_with_three_hearts: :slightly_smiling_face: precisely to the section: Download, latest version.
once the image is written to SD, insert in the Raspberry PI and connect away SSH (Username Password for Docker SSH I’m: “pirate” “hypriot” --> (User: pirate) (Pass: hypriot).) obviously after connecting SSH change the credentials to your liking from --> sudo raspi-config, restart Raspberry.
once restarted, connect with SSH and install “Discourse” following this guide: https://linoxide.com/how-tos/install-discourse-docker-container/ :wink: obviously you will start from the point 2) because Docker you installed it right from the start.

good fun.

2 Likes

Hi Massym,

I followed your instructions, installed hypriot, etc., but got the following error:

  $ ./launcher bootstrap app
  standard_init_linux.go:211: exec user process caused "exec format error"
  Your Docker installation is not working correctly

  See: https://meta.discourse.org/t/docker-error-on-bootstrap/13657/18?u=sam

Any thoughts?

Thank you.

1 Like
2 Likes

I really appreciate your prompt reply, Rafael.

Apparently I was mistaken in inferring that Massym successfully got Discourse running on a Raspberry Pi 4 as rereading his post, he doesn’t specifically assert that. Big waste of time on my end, but at least a learning exercise.

What specific component within Discourse is not supported? I and I’m sure many others would be eager to get it working.

Thanks.

1 Like

I would go ahead and guess that Discourse is using images built for x86_64 that being Redis, Ruby, PostgreSQL.

1 Like

It’s our V8/MiniRacer lib, that runs Javascript on the server.

Now that Apple introduced the M1 processor family I’m sure that we will get that working on ARM soon enough.

11 Likes

I’m looking forward to see that working. One of my forums, running on discourse, is the last item I have pending while moving into a rpi4 cluster, which consumes infinitely less power than the intel based server.

2 Likes

Bump, were there any advances on the v8 gem for ARM?, I tried to compile the images, but always got stuck at that gem, it’s a little bit intricate , it fails mostly because the scripts will try to download X86_64 tools (for the build) and run them in ARM…

1 Like

See:

3 Likes

ARM on the server (and in Ruby) will make a lot of progress very soon thanks to Apple’s amazing M1 chip finally appearing in a real laptop.

But the Raspberry Pi itself – even the much improved 4 – is woefully underpowered to be a server. Per this post and the Speedometer 2.0 results…

3B+ Buster 32-bit kernel
9.49/9.66/9.46 = 9.54 Chromium

4B4 Buster 64-bit kernel (32 bit had equal results)
17.2/17.0/17.1 = 17.1 Chromium

OnePlus 7 Pro smartphone (Snapdragon 855, 8GB RAM, Android/Oxygen OS 10)
36.3/35.9/36.8 = 36.3 Chrome

HP Chromebook x2 (dual core M3-7Y30)
68.2/68.6/68.0 = 68.3 Chrome OS 78

Legion Y520 budget gaming laptop (i7-7700HQ Win10x64)
87.4/86.8/87.3 = 87.2 Chrome

Based on those numbers, I hypothesize that a theoretical future Raspberry Pi 5, if it …

  • at least doubles performance over the Pi 4
  • has a mini M.2 SSD of some kind for storage, not an SD card

… could maybe be a viable Discourse server for a very low traffic Discourse forum?

3 Likes

Soon to be seen, I have been running other rails applications on rpi4 and I was happy about the performance, but I must admit they were much simpler than discourse.

3 Likes

This is now supported

7 Likes