Benchmarking SSDs with fio

Fio which stands for Flexible I/O Tester is a free and open source disk I/O tool used both for benchmark and stress/hardware verification that i mainly use for benchmarking ceph or specific ssd harware.

When using an SSD make sure it’s pre-warmed. This can be done using the dd command:

dd if=/dev/zero of=/dev/xvdb bs=100M &

After this you can start performance measurement with fio. My advice is to run this test for 6 to 8 hours in order to get real data out of it.

fio --filename=/dev/nvmeXnXpX --direct=1 --rw=randwrite --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=128k --iodepth=16 --numjobs=1 --time_based --runtime=86400 --group_reporting –-name=benchtest

This command will run for 24 hours and perform write-only workload of 128k blocks on a single process.

Random Read test

sudo fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=512M --numjobs=4 --runtime=240 --group_reporting

This will use 4 processes, run for 2 minutes and only perform read iops.

Random Write test

sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75

This will to a read/write test on a 4 GB file.

Please follow and like us:
error