DietPi startet its history more than 6 years ago and has a successful broadband usage in more than 100,000 active systems. There are a couple of other Debian based distributions where the DietPi team did comparisons to. This article describes these statistics.
1. Comparison overview
The comparison data is published on the DietPi statistics page:
1.1 Distributions compared to DietPi
The following Debian based distributions were compared:
- Raspberry Pi OS Lite (32-bit)
- Raspberry Pi OS Lite (64-bit)
- Armbian (server image) on ODROID C4
- Armbian (server image) on NanoPi R2S
- Armbian (server image) on NanoPi NEO3
- Debian (server image) on ODROID C4
- Debian (server image) on x86_64 PC
DietPi users are hereby encouraged to do own comparisons (e.g. on other hardware variants) and publish the results to this blog post, so that we can add further data to the DietPi statistics page. Therefore the comparison commands are given by the first tile “Test commands” and we provide a script to make their execution easy and consistent: https://github.com/MichaIng/hacks/blob/main/dietpi-distro_comparison
1.2 Comparison attributes
First of all: The DietPi distribution comparison does not claim to be comprehensive. It covers some basic properties but does not give a broadband overall overview. The chosen attributes shall only give an impression of the DietPi benefits, regarding one of our major aims: to be lightweight and performant also on small hardware with little RAM, disk space and CPU power.
The comparison examines the following attributes
# | Criteria | Unit |
1 | RAM usage | bytes |
2 | Running processes | number of processes |
3 | Disk usage | bytes |
4 | Pre-installed packages | number of packages |
5 | Boot duration | seconds |
6 | Temporary files in RAM | yes/no |
7 | Logs in RAM | yes/no |
8 | SSH pre-installed | yes/no |
9 | Download size | bytes |
10 | Image size | bytes |
11 | Build date |
These comparison attributes (criteria) are explained below: What is the comparison procedure (commands) and what is the relevancy of these KPI values?
1.2.1 RAM usage and Disk usage
Especially the RAM usage in SBC systems with less memory is essential for the overall system speed, because low RAM usage avoids time consuming swapping and gives more available cache memory. The following graphics shows a memory consumption on a X11 based VM with its memory consumption (green arrow) and the cache usage (yellow arrow).
The disk usage is relevant only with smaller SD cards resp. system disks. It is not a performance killer.
1.2.2 Running processes
The number of running processes contributes to the RAM usage and may also contribute to available computation resources. Another aspect is, that fewer processes means fewer possibly unknown or unexpected system tasks and behaviour, like services listening on network ports and answering to requests, providing information about the system and other tasks.
1.2.3 Pre-installed packages
The number of pre-installed packages corresponds directly to the number of running processes and hence memory usage, as well as disk usage.
1.2.4 Boot duration
Fewer system services and processes means fewer boot tasks, so that DietPi usually boots faster than other Debian based distributions.
1.2.7 Temporary files in RAM and Logs in RAM
DietPi aims to be optimised for minimal disk writes, by having temporary files and logs by default stored on a tmpfs
RAM drive, which contributes positively to the lifetime of the system drive and performance of operations which involve related writes, especially when the system drive is an SD card.
1.2.8 SSH pre-installed
While it is trivial to install a desktop environment, DietPi aims to be a server system in the first place, and hence needs to be maintainable headless, without a monitor and keyboard physically attached. For this reason the ability to login via SSH is crucial, which is in our case with the lightweight Dropbear SSH server.
1.2.9 Download size and image size
As a result of the low pre-installed package count, DietPi images are naturally small.
2. Comparison results
The results show that our efforts to ship DietPi as a minimal Debian system with low memory and disk usage and low boot times are paying out. There are two cases where DietPi is defeated in single attributes:
- Most DietPi images ship with a dedicated FAT
/boot
partition, which holds the kernel, in case initramfs, boot configuration and DietPi scripts. On Raspberry Pi this is strictly required. It has the benefit that the most important files responsible for system boot can be accessed and in case repaired from any other OS, like Windows or macOS. Same is true for pre-configuring DietPi viadietpi.txt
before first boot. The downside is that this partitioning leads to additional empty space in the disk image and cannot be compressed as effective as a single partition image. Debian server image can hence be smaller than DietPi images, even if the actual disk usage is higher. - Debian server images, when using the netboot installer without selecting any additional software, ship without full WiFi support and without common WiFi USB adapter firmware installed. We want DietPi images to have full WiFi support out-of-the-box, which implies additional disk usage especially for a set of firmware packages.
OS | Temp. files in RAM | Logs in RAM | SSH pre-installed |
DietPi | yes | yes | yes |
Rasp. OS Lite (32-bit and 64-bit) | no | no | optional |
Armbian (NanoPi R2S, ODROID C4, NanoPi NEO3) | yes | no | yes |
Debian (ODROID C4, x86_64 PC) | no | no | yes |
3. Execute your own comparison
If you want to do an own comparison the used commands are given in the icon “Test commands”.
To generate a comparison just execute a pre-made shell script given there. Therefore edit a script (e.g. with the nano editor: nano dietpi-distro_comparison.sh
), paste the script text into the editor and store it. Afterwards activate the execution flag via the chmod +x <shell_script_name>
command (e.g. chmod +x dietpi-distro_comparison.sh
).
After this, you can execute the script (e.g. . ./dietpi-distro_comparison.sh
). The script does all measurements and at the end needs a reboot. After the reboot you have to re-execute the script and are then able to read out the resulting values.
To provide consistent results, the script does an initial alignment, full package upgrade and a reboot. On the second run, it performs the actual tests and prints the results.
Remark: You need to run this script on a system which is set to C.UTF-8 or en_GB.UTF-8 (within /boot/dietpi.txt
) to get the correct data output: The script filters some keywords which will not be found in other language settings.
This looks like what I need when I get back to my Pi.
It appears that this is exactly what I will require when I return to my Pi.
Thank you for the great comparison.
Is it relatively straightforward to get extra bits working that work out-of-the-box on the normal pi-lite distribution? e.g., to apt-get install the things needed for the newer Pi cameras? Or drivers for 4g dongle?
Yes it is as easy like you mentioned.
I think the x86_64 boot time is probably the most frustrating thing there, on Debian it’s more than 3x faster.
DiePi offers pre-configured setups for various applications like web servers, and game servers. this can save you time and effort compared to manually configuring a standard Debian system.