The Problem
I've setup my Raspberry Pi 1B+ running DietPi as a Time Machine backup destination as per this tutorial. I have attached a 2TB Western Digital USB 3.0 disk. Obviously this is an old Pi so I am not expecting great speeds, but I get 6 MB/s and I have trouble figuring whether the bottleneck is the CPU or the shared network / USB controller.
The Details
- The CPU is set to
900 MHz, 250 MHz core, 400 MHz SDRAM, 2 overvolt
. - The Pi is connected directly to the router with a Cat 5E cable. I have also tried with a USB to Ethernet adapted in between, this made no difference.
- I have done a local disk write benchmark to gauge the external disk performance using
dd bs=10M count=50 if=/dev/zero of=/mnt/timemachine/test.bin
; 17.4 MB/s. - I have done a network test between my MacBook and the Pi using
iperf
with the Pi as the server; 83.6 Mbits/sec. During this, Pi CPU usage was around 85%. - I have done a remote disk write benchmark from the MacBook to the Pi using
dd bs=10M count=50 if=/dev/zero of=/Volumes/timemachine/test.bin
; 6756683 bytes/sec (~6.75 MB/s). During this, Pi CPU usage was around 100% (thesmbd
i.e. Samba process specifically).
The Speculation
- From the local disk write benchmark, it appears that the disk or USB hub by itself is not the bottleneck.
- From the network test between the client and Pi, the 83.6 Mbit/sec would indicate that the maximum Ethernet speed I can expect is ~10.5 MB/sec, without any of the overhead of Samba etc.
- From the remote disk write benchmark, it appears that either the CPU or the shared USB / Ethernet controller is the bottleneck. Given that 6.75 MB / sec * 8 = 54 Mbit / sec, this is only a fraction of the theoretical 480 Mbit / sec of USB 2.0 that the B+ controller should be capable of, even if overhead is taken into account. The CPU usage appears to indicate a bottleneck there, but lowering the CPU to the default profile of
700 MHz, 250 MHz core, 400 MHz SDRAM, 0 overvolt
does not appear to impact performance.
The Question
Is the current bottleneck the CPU, or the shared USB / Ethernet controller, and how large is the difference?
In case of the former, it is straightforward to upgrade. If it is the latter, it must be an RPI 4 or some other fancy SMB that provides a gigabit ethernet without sharing a bus with the USB hub, which is costly.
sudo sysctl debug.lowpri_throttle_enabled=0
andsudo sysctl debug.lowpri_throttle_enabled=1
to re-enable throttling (though I'm pretty sure this value resets to enabled after reboot).