Evaluation Item 5: TF Card Read & Write Speed Test
As a foreword, this post is part of our horizontal evaluation of Raspberry Pi 5 and other models. Please see that post for further information on the evaluation. For the other tests we’ve gone over in this series, you can check out the links below:
Evaluation Item 1: CPU Test
Evaluation Item 2: Memory Test
Evaluation Item 3: Network Test
Evaluation Item 4: NGINX Performance
Have you ever encountered a situation where the operation of your Raspberry Pi is laggy or slow? When you check the board’s resource usage, you will find that CPU usage is not high. What is the reason for this slowdown?
This is actually caused by the slow read and write speeds of the TF card used to install the system. Different Raspberry PI models have different speeds when reading and writing TF cards, even if you use a high-speed TF card. Next, we will test the read and write speeds of the TF card. The TF cards used on Zero 2W, PI3B+, PI4, and PI5 are all 32GB/Class10 TF cards. The official data shows that the maximum reading speed is 100MB/S and the maximum writing speed is 45MB/S. The test tool used this time is Flexible I/O Tester, which tests 4 groups of read and write. The test instructions are as follows:
fio --loops=5 --size=500m --filename=fiotest.tmp --stonewall --ioengine=libaio --direct=1
–name=SeqRead --bs=1m --rw=read
–name=SeqWrite --bs=1m --rw=write
–name=512Kread --bs=512k --rw=randread
–name=512Kwrite --bs=512k --rw=randwrite
–name=4KQD32read --bs=4k --iodepth=32 --rw=randread
–name=4KQD32write --bs=4k --iodepth=32 --rw=randwrite
–name=4Kread --bs=4k --rw=randread
–name=4Kwrite --bs=4k --rw=randwrite
型號 | PCIe |
---|---|
PI 5 | 1×PCIe 2.0 介面 |
PI 4B | NO |
PI 3B+ | NO |
PI Zero 2W | NO |
The test process is relatively long and complicated because the speed of the TF card is indeed slow. The test results are as follows (Figure 1). From the chart, we can see that the TF card read and write speeds of PI 5 largely reach the maximum speed of the TF card, and the data of other development boards are all satisfactory.
Figure 1
According to the above data, although PI 5 is as fast as you can get when reading and writing TF cards, there is still a bottleneck in this speed. If you want a better user experience, you can consider the PI 5’s unique peripheral - PCIe. We can install a solid-state drive through the PCIe to an NVME solid-state drive adapter board, and then install the system on the solid-state drive.
In the following test, we have connected a 500G NVME SSD with a pre-installed system to the PI 5. When we enter the system, we can see that the system is booted from the SSD. Next, we run Flexible I/O Tester again. From Figure 2, we can see that this test is very fast. We compare the data of booting from the SSD and the TF card. Through data comparison, the reading and writing speed of using SSD is more than 10 times faster than that of using TF card. Even when we are using the desktop environment, the operation becomes very smooth.
Figure 2
In addition to being able to connect to SSDs, the PCIe interface of PI 5 can also be used to expand the 2.5G network interface. This is good news for users who play with NAS. We first install the PCIe to a dual 2.5G network interface expansion board, and then use iperf to run an intranet speed test. Figure 3 shows the data obtained using the PCIe to dual 2.5G network interfaces and the PI 5’s built-in Gigabit network interface. The speed of the 2.5G network interface is 1.5 times that of the Gigabit network interface, which is quite suitable for NAS applications. Of course, the prerequisite for using the 2.5G expansion is that other devices in the local network must also support it.
Figure 3