Re: rpi4 as server? By: Mike Scott to All on Sat Nov 28 2020 11:33 am
The PIs are not great at I/O. They will do for a personal server with a couple of users, but it is not ideal as a server platform.
II don'tknow about the newer PIs, but at least the early ones used an USB bus for the ethernet connection, which meant network I/O was limited from the start.
I currently use an old i386 machine as home server (everything from local NFS file-store, to bind, to email server). It's an acer aspire r3700, running at 1.8GHz, 2 proc/4 thread job. It runs freebsd headless, and I use vnc for day-to-day operations on it.
I'm contemplating replacing with a rpi4, which I gather is now supported by freebsd, using a usb3 external hard drive. But is this likely to prove slower or problematic for any other reason?
My colleague who develops FreeBSD on the Pis recommends this image for the Pi3 and 4 - the 13.0-CURRENT release may not support the Pi 4:
formatting link
It is recommended that you boot Raspberry Pi OS and do a firmware update before you boot FreeBSD - the above might not have the right firmware for especially 8GB boards.
I think you'll be pleasantly surprised by FreeBSD on a Pi. It works relatively well, but be aware that Pi4 support is still only in -current. There's some "mucking about" to be done yet.
Best to browse the freebsd-arm mailing list archive to see if it's progressed to the point of being useful to you.
For my part, FreeBSD has made an admirably functional platform for bind, apache and sendmail. It's less useful as a workstation; I'm typing this on a Pi4 ssh'd into a Pi2. There are not yet precompiled applications in any great variety, but command-line programs build via the ports collection very reliably. Self-hosting can be done with a little fussing, Xorg built without too much trouble, but browsers are a major pain to compile.
Why post if you don't know. The Pi4 has a true 1 Gbps ethernet port and two usb 3.0 ports of 4.8 Gbps (what others now call usb 3.1 gen 1). This is possible because the new chip has PCIe (x1).
I use my rpi4 4GB as a Samba Server using USB3 disks, 2.5 HDD and SSD. I can't remember exact figures, but performance was close enough to gibabit ethernet for me to stop worrying. 2.5 HDD needs an additional USB power supply
SSD USB to SATA cable.
2.5 USB to SATA cable.
I also use the same rPi 4 to to provide a number of other services via docker. Things like Deluge, Gitea, Gollum, Motion Eye. It isn't really powerful enough for motion eye (motion detection), but fine for the others
I seem to be running Unbound of my FreeBSD router (not a rpi), I'm not sure if it really is better than BIND or if this is just fashion. It does freeze occasionally, maybe once ever 3 or 4 months.
Buy an RTC addon for those times when it reboots, and setup NTPD on it, sync'ing from a couple of reliable internet timeservers. Then run the Pi as your network time source.
My home serving Pi is setup like that. Not that the RTC addon is used much, as my Pi only reboots once in half a dozen blue moons! I do sync the RTC from the system even day - so it isn't out by much if it does reboot, until it gets ntp sync. ntp maintained system time is far far more accurate than any RTC
Thanks all for the comments. I've played with a pi3 (and earlier), but it's clearly too slow even for my home network; I'm sort-of hoping a pi4 would be up to the job. Just a little pricey to buy and try yet another unless there's a real chance it'd be a go-er.
I've had fbsd running on the pi3, an unsupported 12.x. Actually, I'd seriously consider switching to a linux, except that I'm doing things using pf that don't seem readily possible with iptables (although maybe I've missed something).
The present pi3 has a rtc attached to help it on its way; the existing server has a (low-grade) gps dongle plus uses external ntp servers as backup. It provides time to our lan. Good to
To avoid disappointment, I think you should try & establish some performance criteria, as detailed and specific as possible, that you'd be happy with. Then investigate if they can be met (for example, by asking here or on the RPi forum). For instance:
- must be freebsd
- will be used wired on a gigabit switch
- application is samba server
- large file read throughput must be x MB/s
I use my Pi4 4GB on ethernet, it boots from usb3 ssd, it's in a passive heatsink case (cpu temp below 40C for ambient of ~18C). It runs my development web server + database (apache2, php7, mariadb10) which it does fine. I run some backup scripts which I never notice interfering. I test bash scripts, no problem of course. Sometimes I fire up VNC from my desktop and use Mathematica on the Pi which is a bit slow but useable. Recently I set it up as a jupyter notebook server on the LAN which works well (but I end up using the local python install, anyway). Without overclock:
$ time /usr/bin/factor 1234567890123456789012345678901
Interesting: for exactly the same number to be factored I see:
System Real User Sys CPU ====== Lenovo T420 0.254s 0,252s 0.002s 1.9GHz Core i5 Lenovo R61i 0.702s 0.693s 0.006s 1.6GHz Core Duo Whitebox PC 0.321s 0.314s 0.004s 1.0GHz AMC Dual Athlon RPI 2B 21.995s 11.496s 0.040s
I'd been wondering whether an RP14B would be a good replacement for the old AMD whitebox, but it looks as if a some sort of mini-ITX system would be a better bet because I do all backups via rsync to a removable USB drive connected to the old AMD system, and to do what I need it to do, a replacement would need a minimum of 4 USB ports plus SATA and a VGA- capable display port.
Thanks for posting those numbers, though - doing so gave me the kick needed to compare those speeds.
It's interesting that my Core i5 desktop is actually a little faster than the Core i7 Lenovo laptop as the Lenovo is newer as well and, subjectively, often feels a little faster.
Why my Pi 2B is so much faster than yours I don't know, it's a Pi 2B Revision 1.1.
However the real 'wow, that's a lot faster' thing for all of them was to move from spinning disks to SSDs. (The t470 of course had one to start with).
Bear in mind that you're probably running a 32 bit RPi OS (on the Pi 2 you will be), and the PCs are probably running 64 bit binaries. That'll make a large difference to the speed of the arithmetic for this test.
Also to note that GNU Factor can be compiled to use libgmp, which has custom assembler implementations of key functions. It appears the one on Ubuntu
18.04 isn't compiled that way, but that could make a large difference in performance if different OSes are compiled different ways (as well as the ARM v x86 comparison being different)
I don't think it's a particularly good benchmark to compare across architectures. And of course it's only single threaded.
That sounds like what you care about is I/O performance rather than CPU performance. Also bear in mind that mini ITXes are (mostly) a completely different power class from the RPi. Horses for courses.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.