Help Center> Dedicated Distributed Storage Service> FAQ> How Can I Test DSS Disk Performance?

How Can I Test DSS Disk Performance?

Precautions

In the DSS disk performance test, if the start cylinder number is not 4-KB aligned, the DSS disk performance will be greatly affected. Ensure that the start cylinder number is 4-KB aligned before you start the test.

Windows

The method for testing a DSS disk varies depending on the in-use server OS. This part uses Windows 7 Professional 64-bit as the example OS to describe how to test the DSS disk performance. For other Windows OSs, see the corresponding OS documents.

Install performance measurement tool Iometer before the test.

  1. Log in to the server.
  2. Press win+R to open the Run window. Enter msinfo32 and click OK

    The system information window is displayed.

  3. Choose components > storage > disks. In the right pane, view the partition offset value.
    • If 4096 can be divided by the parameter value, the partition is 4-KB aligned. Go to 4.
    • If 4096 cannot be divided by the parameter value, the partition is not 4-KB aligned. If you need to continue to perform the test, ensure the 4-KB alignment for the partition.

    Data losses will occur when you delete the partition and select another start cylinder number for the 4-KB alignment. Exercise caution when perform such an operation.

  4. Use Iometer to test the DSS disk performance. For details, see the Iometer product document.
  5. When the disk IOPS and throughput are tested, the parameter configurations for Iometer and fio are the same. For details, see Table 1.

Linux

When you use an old version Linux OS, for example CentOS 6.5, and run fdisk to create partitions, the default start cylinder number is not 4-KB aligned, which will greatly affect the test performance. For that reason, if such an OS is used, you are advised to select a new start cylinder number that is 4-KB aligned when creating partitions.

The method for testing a DSS disk varies depending on the in-use server OS. This section uses CentOS 7.2 64-bit as the example OS to describe how to test the disk performance. For other Linux OSs, see the corresponding OS documents.

Install performance measurement tool fio before the test.

  1. Log in to the server and switch to user root.
  2. Before you start the test, run the following command to check whether the start cylinder number is 4-KB aligned:

    fdisk -lu

    Information similar to the following is displayed:

    [root@ecs-centos sdc]# fdisk -lu 
     
    Disk /dev/xvda: 10.7 GB, 10737418240 bytes, 20971520 sectors 
    Units = sectors of 1 * 512 = 512 bytes 
    Sector size (logical/physical): 512 bytes / 512 bytes 
    I/O size (minimum/optimal): 512 bytes / 512 bytes 
    Disk label type: dos 
    Disk identifier: 0x7db77aa5 
     
        Device Boot      Start         End      Blocks   Id  System 
    /dev/xvda1   *        2048    20968919    10483436   83  Linux 
     
    Disk /dev/xvdb: 10.7 GB, 10737418240 bytes, 20971520 sectors 
    Units = sectors of 1 * 512 = 512 bytes 
    Sector size (logical/physical): 512 bytes / 512 bytes 
    I/O size (minimum/optimal): 512 bytes / 512 bytes 
     
     
    Disk /dev/xvdc: 53.7 GB, 53687091200 bytes, 104857600 sectors 
    Units = sectors of 1 * 512 = 512 bytes 
    Sector size (logical/physical): 512 bytes / 512 bytes 
    I/O size (minimum/optimal): 512 bytes / 512 bytes 
    Disk label type: dos 
    Disk identifier: 0x3cf3265c 
     
        Device Boot      Start         End      Blocks   Id  System 
    /dev/xvdc1            2048    41943039    20970496   83  Linux
    • If the start cylinder number can be divided by 8, the partition is 4-KB aligned. Go to 3 to start the test.
    • If the start cylinder number can be divided by 8, the partition is not 4-KB aligned. If you need to continue to perform the test, select another start cylinder number to ensure the 4-KB alignment for the partition.

    Data losses will occur when you delete the partition and select another start cylinder number for the 4-KB alignment. Exercise caution when perform such an operation.

  3. Run commands and use fio to test the disk performance:
    • To test random write IOPS, run fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=8k -size=10G -numjobs=1 -runtime=600 -group_reporting -filename=/dev/[device] -name=Rand_Write_IOPS_Test.
    • To test random read IOPS, run fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=8k -size=10G -numjobs=1 -runtime=600 -group_reporting -filename=/dev/[device] -name=Rand_Read_IOPS_Test.
    • To test write throughput, run fio -direct=1 -iodepth=32 -rw=write -ioengine=libaio -bs=1024k -size=10G -numjobs=1 -runtime=600 -group_reporting -filename=/dev/[device] -name=Write_BandWidth_Test.
    • To test read throughput, run fio -direct=1 -iodepth=32 -rw=read -ioengine=libaio -bs=1024k -size=10G -numjobs=1 -runtime=600 -group_reporting -filename=/dev/[device] -name=Read_BandWidth_Test.
    • Table 1 lists the fio test parameters.
    Table 1 Parameter description

    Parameter

    Description

    direct

    Defines whether direct I/O is used. The values are as follows:

    • If the value is set to 0, buffered I/O is used.
    • If the value is set to 1, direct I/O is used.

    iodepth

    Defines the I/O queue depth. The default value is 1.

    The defined queue depth refers to the queue depth of each thread. That said, when multiple threads are tested, the parameter defines the queue depth of each thread.

    Total fio concurrent I/Os = iodepth x numjobs

    rw

    Defines the test read/write policy. The parameter value can be as follows:

    • Random read: randread
    • Random write: randwrite
    • Sequential read: read
    • Sequential write: write
    • Mixed random read/write: randrw0

    ioengine

    Defines how fio delivers the I/O request (synchronously or asynchronously).

    • Synchronous I/O: Only one I/O request is delivered at a time, and the response is returned after the kernel has processed the request. That said, the single-thread I/O queue depth is always less than 1, and multi-thread concurrent processing can be used to handle such issues. Normally, 16 to 32 concurrent working threads fully occupy the I/O queue depth.
    • Asynchronous I/O: Multiple I/O requests are delivered using libaio at a time. Wait for the process to complete and reduce the interaction times to improve efficiency.

    bs

    Defines the I/O block size. The unit can be KB, Kb, MB, and Mb, and the default value is 4 KB.

    size

    Defines the amount of data processed by the test I/Os. If parameters, such as runtime, are not specified, the test ends until fio has processed all the specified data amount.

    The value can be a number with a unit or percentage. A number with a unit indicates the read/write data amount, for example size=10G, indicating a 10-GB read/write data amount. A percentage indicates the ratio of read/write data amount to the capacity of total files, for example size=20%, indicating the read/write data amount takes 20% of the total file space.

    numjobs

    Defines the number of concurrent threads.

    runtime

    Defines the test time.

    If this parameter is not specified, the test ends until the specified data amount is processed by the block size defined using parameter size.

    group_reporting

    Defines the test result display mode. The parameter value displays the statistics on a single thread instead of that on all jobs.

    filename

    Defines the name of the test file or device.

    • If a file is specified, the performance of the file system is tested. Example: -filename=/opt/fiotest/fiotest.txt
    • If a device name is specified, the performance of the raw disk is tested. Example: -filename=/dev/vdb1
      NOTICE:

      If the test is performed on a disk already has partitions and file systems created as well as data on it, user parameter filename to specify a file so that the original file system is not damaged and the data is not overwritten.

    name

    Defines the test task name.