site  contact  subhomenews

Results of drive speed test at bootup

June 09, 2022 — BarryK

Users of EasyOS will have seen a message on the screen, very early in bootup, showing "read speed test". Firstly, there is a message about looking for the drives, then this:

Working drive read speed test (lower the better): ${TIME10k}

...where that $TIME10k is a number, two or three digits.

Forum member rufwoof is running Easy 4.0, booted on a very slow flash-stick, and I asked him what that speed value is. This is his reply:

https://forum.puppylinux.com/viewtopic.php?p=59288#p59288

Quoting:

Read speed 116.

Generally that sandisk is quite good/quick for reads, slow for writes. A couple of years old now and been written quite a few times so perhaps near EOL.

Oddly, my external usb3 HDD shows 426 when plugged into a usb3 port, and 393 when plugged into a usb2 port. All seems upside-down to 'lower is better'.

This is how the 'init' script in the initrd conducts the speed test, for the example of working-drive being sdb:

# WKG_DRV=sdb
# busybox dd if=/dev/${WKG_DRV} of=/dev/null bs=1024 count=64 iflag=skip_bytes skip=536870912
64+0 records in
64+0 records out
65536 bytes (64.0KB) copied, 0.012842 seconds, 4.9MB/s

....$TIME10k is that highlighted value, times 10,000. So, move the decimal point four places to the right, gives 128.

I concocted this test partly to be able to distinguish between solid-state and rotating-platter (HDD) drives, as the Linux kernel does such a poor job of it. That "skip=536870912" will cause the HDD pickup head to move a considerable distance, so the read-speed for HDDs is going to be considerably higher than for solid state drives.

Here are some results:

USB3.0 HDD
356
Internal SATA HDD
188
Emtec USB2 flash-stick
130
SanDisk Ultra USB3.0 flash-stick
68
SanDisk Extreme USB3.1 flash-stick
46
WD SE Elements USB3.0 SSD
32
Internal PCIe NVME SSD
14

If you would like to conduct this test in a terminal, yes, can do; however, be careful of drive caching. You will get the correct result the first time. Repeated tests will be faster due to caching.

As well as distinguishing between HDD and SSD, the initrd uses this speed test to decide whether to copy 'easy.sfs' into RAM. This is the code in 'init' script:

#decide whether to copy easy.sfs to RAM, or not...
CPYflg=0
[ $FREEK -gt 3100000 ] && CPYflg=1 #>3GB ram then copy
[ $TIME10k -lt 100 ] && CPYflg=0 #but fast drive so don't copy.
[ $FREEK -gt 6100000 ] && CPYflg=1 #but heaps of ram, so copy.
[ $TIME10k -lt 15 ] && CPYflg=0 #but super-fast drive so don't copy.
[ "$xWKG_DEV" ] && CPYflg=1 #LOCKDOWN, will be running totally in ram.

...where $FREEK is the amount of free RAM space.

So, it is a juggling act between different factors. If end up with CPYflg==1 then 'easy.sfs' will be copied to RAM. Some of those settings go back many years, and we might want to revisit them. In fact, looking at it right now, reckon this can be improved, so have just now made changes, highlighted.    

Tags: easy