To test disk random write speed use the following command:
fio --name fio --readwrite=randwrite --ioengine=libaio --direct=1 --filename=fio --numjobs=1 --size=4G --gtod_reduce=1 --iodepth=64 --bs=16k --fsync=1
Which will run a test with the following parameters:
Block Size | 16KiB |
IO Depth / Queue Depth | 64 |
Number of Jobs / Threads | 1 |
Test Type | Random Writes |
fsync() | Enabled While you may get much higher speeds with fsync() being disabled, it is important to enable it for this test. Enabled fsync() allows to correctly benchmark random write speeds for database operations which is important factor for a web server. |
On a server with a problematic drive you’ll see something like this (less than 1000 IOPS):
On a reasonably ok server you’ll see around 10-15k IOPS:
On a ultra-fast high end server you’ll not even see the test running – result is usually more than 100k IOPS:
WordPress Hosting Benchmark comparsion – good vs bad write speeds with fsync()
These tests have been performed with WordPress Hosting Benchmark Tool on two similar systems where one has a consumer grade SSD, while the other one has two enterprise grade SSDs in a raid array. The test results prove that a random write speed with fsync() being on is an important factor in choosing the right NVME SSD for a web hosting.
Useful resources for testing SSDs
IOPS to MB/s Calculator by wintelguy.com – will help you to easily convert between IOPS and MB/s for better understanding of benchmark results. Block size is important in this calculation. In this article I’m using 16KiB of block size for my measurements.
SSD Specs Database by techpowerup.com – large database of datasheets for SSD drives, containing very detailed technical information about each SSD drive, such as performance metrics, controller data, features, etc.
Quick overview of FIO utility parameters by linux.die.net – will help you to gain better understanding what’s happening “under the hood” when running the FIO commands
Test disk performance by using dd command – by cyberciti.biz – alternate way of testing disk performance by using “dd” command (server throughput and latency).
Plesk for Linux server is running slow: too much IO interactivity – More commands from PLESK to test the disk speed by using “dd” and “iotop” utilities