This topic describes how to test the IOPS performance of an enhanced SSD (ESSD). The specifications of the disk and the test conditions affect the test results. If you configure the test conditions as described in the following example to fully use the performance of multi-core processors and concurrency, you can obtain an IOPS of one million when you perform a stress test on the ESSD.
Test conditions:
- Sample operation: random write (randwrite).
- Image: We recommend that you use a later version of a Linux public image provided by Alibaba Cloud, such as CentOS 7.4 64-bit, CentOS 7.3 64-bit, CentOS 7.2 64-bit, or Alibaba Cloud Linux 2.1903 64-bit.
- Tool: We recommend that you use fio.
- Instance type: We recommend that you use ecs.g5se.18xlarge.
- ESSD: We recommend that you use a PL3 ESSD. In this example, the device name of the
ESSD is /dev/your_device. Replace it with your actual device name. For more information,
see ESSDs.
Warning
- You can obtain accurate test results by testing raw disk partitions. However, you may destroy the file system structure in a raw disk partition if you directly test the partition. Before you test a raw disk, we recommend that you create a snapshot of the disk to back up your data. For more information about how to create a snapshot, see Create a snapshot for a disk.
- We recommend that you do not test a disk where the operating system is located or a disk that stores important data. To prevent data loss, we recommend that you use a new Elastic Compute Service (ECS) instance that contains no data for the test.
Procedure
Details about the test100w.sh script
- In the script, the following command sets the
rq_affinity
parameter to 2:echo 2 > /sys/block/your_device/queue/rq_affinity
Value of rq_affinity Description 1 Indicates that the block device delivers the received I/O completion event to the group of vCPUs that submit the corresponding I/O requests. In scenarios where multiple threads concurrently run, the I/O completion event may be delivered only to one vCPU and cause a performance bottleneck. 2 Indicates that the block device delivers the received I/O completion event to the vCPU that submits the corresponding I/O requests. In scenarios where multiple threads concurrently run, each vCPU can deliver its maximum performance. - The following command runs
jobs
to bind queues to different CPU cores:fio -ioengine=libaio -runtime=30s -numjobs=${numjobs} -iodepth=${iodepth} -bs=${bs} -rw=${rw} -filename=${filename} -time_based=1 -direct=1 -name=test -group_reporting -cpus_allowed=$spincpu -cpus_allowed_policy=split
Note In normal mode, a device has a single request queue. This request queue becomes a performance bottleneck when multiple threads concurrently run to process I/O. In multi-queue mode, a device can have multiple request queues to process I/O and deliver the maximum backend storage performance. For example, you have four I/O threads. To make full use of the multi-queue mode and improve storage performance, you must bind these threads to the CPU cores that correspond to different request queues.Parameter Description Example numjobs
The number of I/O threads. 10 /dev/your_device
The device name of the ESSD. /dev/vdb cpus_allowed_policy
The parameter provided by fio to bind vCPUs. fio provides the cpus_allowed_policy
andcpus_allowed
parameters to bind vCPUs.split The preceding command runsjobs
to bind queues to different CPU cores. These queues have different queue IDs. To view the ID of the CPU core to which a queue is bound, perform the following steps:- Run the
ls /sys/block/your_device/mq/
command. In this command,your_device
is your device name. Example: vdb. This command returns the ID of the queue for an ESSD whose device name is in the /dev/vd* format. - Run the
cat /sys/block/your_device/mq//cpu_list
command. In this command,your_device
is your device name. Example: vdb. This command returns the ID of the CPU core to which the queue for an ESSD is bound. The device name of the ESSD is in the /dev/vd* format.
- Run the