You are here

RaspBerry Pi Tools

Just saw that the new Raspberry Pi Zero 2 W (2nd generation, Wireless) has been released. It's equipped with a quad-core CPU, but the RAM is still limited to 512MB. I began to wonder if it may be time to start migrating all of my Kodi-equipped Raspberry Pi 4 models to the zero, but the RAM could be a bit of an issue. Digging into the benchmark tests, I realized I don't have a central record of useful RasPi tools, so here it is.

First off, it's useful to know what you're Pi is running. The following command will provide details of about the CPU.

$  cat /proc/cpuinfo

It may also be useful to know something about your OS.

$ uname -a
$ cat /etc/debian_version

Install the benchmark utility.

$ sudo apt install sysbench

For a benchmark using just a single core (eg., The Pi Zero version 1):

$ sysbench --test=cpu --cpu-max-prime=5000 --num-threads=1 run

My Raspberry Pi 4 Model B V1.2 completed this benchmark in about 37 seconds. According to a video I watched by ExplainingComputers.com, the Pi Zero 1 took about 87 seconds to complete the same benchmark.

We now change the num_threads to 4 so we take advantage of all four cores:

$ sysbench --test=cpu --cpu-max-prime=5000 --num-threads=4 run

In the video, the Pi Zero model 2 completed the test in about 16.2 seconds, while my Pi 4 Model B took 9.1 seconds. This reflects a substantial improvement over the first gen Pi Zero, but still doesn't compete with the Pi 4. However, for non-intensive applications, the Pi Zero 2 with its substantially smaller footprint could certainly replace some older Pi 3 or earlier hardware. One application that comes to mind is a security camera system. I currently use a commercial system but have always thought it would be fun to deploy a custom, raspberry pi-based security system. The quad-core and improved speed would be quite useful for a camera system which employs motion-tracking or motion-triggered capture.

Just for grins and giggles, I ran the same benchmark on my Ubuntu server running on a quad-core 3 GHz Xenon cpu. Somewhat surprisingly, the test took 10 seconds regardless of the number of threads specified. After a little research, I discovered that the Xenon box is running sysbench version 1.0.18, while the Pi 4 is running sysbench 0.4.12. Apparently the newer version includes some design changes including a built-in time limit and a different way of reporting results. Will have to explore this furher, but overall, that little Pi 4 really compares favorably ounce for ounce up against the big tower.

TL;DS

Pi Zero 2 is not quite ready to host the media server.