I don't know about over clocking, but since the two USB 3 ports on the Pi 5 are fed by 4 PCIe lanes, it should be possible to obtain greater bandwidth using RAID0 and two USB SSDs. Maybe one could get 400 MB/sec write speeds this way.I encourage others to validify the claims I am making with their own hardware. It's very observable and repeatable.Show me 5 runs on each of Pi 4 and Pi 5 - there's not a huge difference between the single run on the Pi5 and the single run on the Pi 4 that you posted.
The USB 3.0 SSD I am using is a Samsung T5 500GB, using an EXT2 filesystem.
The benchmark application source can be found in my original post form the C/C++ forum: viewtopic.php?t=367304
In addition I have created a shell script to run the test a number of times ( 10 ) and average the results:For my tests I am using the SAME disk, SAME cable, with the SAME filesystem ( actually do not change the filesystem or format inbetween ), SAME mount options and these are the results I get:Code:
#!/bin/bash# Specify the number of runsN=10# Specify the directory for test_speed_multiTEST_DIR="/media/RAW/"# Initialize sum of write speedssum_speed=0for i in $(seq 1 $N); do echo "Run $i of $N" # Execute the test_speed_multi command and capture its output output=$(sudo ./test_speed_multi "$TEST_DIR") # Extract the write speed using grep and awk speed=$(echo "$output" | grep "Write speed" | awk '{print $3}') # Add this speed to the sum of speeds sum_speed=$(echo "$sum_speed + $speed" | bc) # Remove temporary files sudo rm -rf "$TEST_DIR"* # Wait for 1-2 seconds before the next run sleep 2done# Calculate the average speedavg_speed=$(echo "scale=2; $sum_speed / $N" | bc)echo "Average write speed over $N runs: $avg_speed MB/s"
Raspberry Pi 4 @ 2.0Ghz:Raspberry Pi 5 8BG @ 2.4Ghz( 4K Page ):Code:
pi@raspberrypi:~ $ uname -aLinux raspberrypi 6.1.0-rpi4-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.54-1+rpt2 (2023-10-05) aarch64 GNU/Linuxpi@raspberrypi:~ $ sudo ./benchmark.shRun 1 of 10Run 2 of 10Run 3 of 10Run 4 of 10Run 5 of 10Run 6 of 10Run 7 of 10Run 8 of 10Run 9 of 10Run 10 of 10Average write speed over 10 runs: 312.46 MB/s
Raspberry Pi 5 8BG @ 2.4Ghz( 16K page ):Code:
pi@raspberrypi:~ $ uname -aLinux raspberrypi 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linuxpi@raspberrypi:~ $ getconf PAGE_SIZE4096pi@raspberrypi:~ $ sudo ./benchmark.shRun 1 of 10Run 2 of 10Run 3 of 10Run 4 of 10Run 5 of 10Run 6 of 10Run 7 of 10Run 8 of 10Run 9 of 10Run 10 of 10Average write speed over 10 runs: 255.28 MB/s
Few ways to look at this:Code:
pi@raspberrypi:~ $ uname -aLinux raspberrypi 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linuxpi@raspberrypi:~ $ getconf PAGE_SIZE16384pi@raspberrypi:~ $ sudo ./benchmark.shRun 1 of 10Run 2 of 10Run 3 of 10Run 4 of 10Run 5 of 10Run 6 of 10Run 7 of 10Run 8 of 10Run 9 of 10Run 10 of 10Average write speed over 10 runs: 260.57 MB/s
1. The Pi 5 is on average 18% slower at writes than a Pi 4
2. Both Pi 4 and Pi 5 are well below ( 20-35% ) the practical limit that is described in the USB 3.0 Spec:
https://en.wikipedia.org/wiki/USB_3.0#: ... 0USB%202.0.Would love a Pi engineer to chime in on this behaviour? At the end of the day I am trying to get the Pi5 to write at a consistent 400MB/s to an external USB 3.0 disk and would like to know how to make this happen; and if it is not capable what is the limiting factor? I realize USB 3.0 is handled through RP1 now, can we not overclock that portion of the chip?Considering flow control, packet framing and protocol overhead, applications can expect 450 MB/s of bandwidth.[10]
The "SuperSpeed" bus provides for a transfer mode at a nominal rate of 5.0 Gbit/s, in addition to the three existing transfer modes. Accounting for the encoding overhead, the raw data throughput is 4 Gbit/s, and the specification considers it reasonable to achieve 3.2 Gbit/s (400 MB/s) or more in practice.[12]
Statistics: Posted by ejolson — Fri Mar 15, 2024 2:17 am