Search code examples
linuxubuntuioubuntu-18.04

linux fio IO-speed test confusing result


I was running a few IO-tests on kubuntu 18.04 with the tool fio on my flash drive (/dev/sdc1) to measure the reading and writing speed of my device with differnet circumstances. But after a while I got these really confusiong results. On the device's website they say, that the writing speed goes up to 150MB/s (see link). But I got a higher result (see image 1), I got bw = 151974KB/s for writing. I tested the device on my Windows PC, too, and got different results, like ~100 MB/s, which is much more realistic. How is this possible? I also listed the output of lsblk and blkid (see image 2). Here's my command line:

   sudo fio --rw=write --name=test1 --size=100M --direct=1 --bs=1024k --filename=/dev/sdc1 --allow_mounted_write=true

https://www.sandisk.com/home/usb-flash/extreme-go-usb

Linux fio benchmark result Linux output lsblk blkid


Solution

  • (NB: this isn't a programming question - perhaps you meant to post this to somewhere like https://serverfault.com/ or https://superuser.com/ ?)

    Your blocksize is huge so you are likely forcing the kernel to split it up into smaller pieces. Usually you intend to check performance with a particular block size that you know won't be broken up so this can be a warning sign. However, it IS a way to force parallelism in terms of what's submitted down to the disk when you aren't using parallel threads/process or an asynchronous ioengine, so it CAN be valid to do this if you understand what you're doing!

    Technically you aren't writing very much (only 100 Mbytes) so while you're bypassing the Linux kernel's cache you may find your writes are ending up in your SSD's cache. You don't say which SSD you have but some can have non-volatile caches of 100s of Megabytes so if all your data just ends up there you will get an unrealistic speed.

    Another issue is that you don't know when your SSD is having to do garbage collection. If it has loads of "unwritten" space then it may go faster than when it is has to do a lot of shuffling to accept the new writes.

    Note that benchmarking SSDs properly is not straightforward. For example see https://www.snia.org/sites/default/education/tutorials/2011/fall/SolidState/EstherSpanjer_The_Why_How_SSD_Performance_Benchmarking.pdf and https://www.snia.org/sites/default/files/technical_work/PTS/SSS_PTS_2.0.1.pdf for starters. Good luck!