Using sysbench to compare the I/O performance of Alibaba Cloud ESSD, SSD cloud disks, and local NVMe disks, covering the test script parameters and the measured differences across storage types
Abstract
On a whim, I wanted to benchmark the performance of Alibaba Cloud’s ESSD against Alibaba Cloud’s local SSD. As it happens, Alibaba Cloud ECS offers several storage types: ESSD, SSD cloud disk, ultra cloud disk, and local NVMe disk. In the end, the NVMe disk did indeed deliver the best performance.
Test tool: this post uses sysbench for testing. Back in my school days I used iometer for benchmarking; sysbench offers more test parameters and richer IOPS testing, whereas iometer leans more toward throughput testing.
Introduction
Refer to my earlier blog post to learn how to install sysbench.
# --file-num=N number of files to create [128] # --file-block-size=N block size to use in all IO operations [16384] # --file-total-size=SIZE total size of files to create [2G] # --file-test-mode=STRING test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw} # --file-io-mode=STRING file operations mode {sync,async,mmap} [sync] # --file-extra-flags=[LIST,...] list of additional flags to use to open files {sync,dsync,direct} [] # --file-fsync-freq=N do fsync() after this number of requests (0 - don't use fsync()) [100] # --file-fsync-all[=on|off] do fsync() after each write operation [off] # --file-fsync-end[=on|off] do fsync() at the end of test [on] # --file-fsync-mode=STRING which method to use for synchronization {fsync, fdatasync} [fsync] # --file-merged-requests=N merge at most this number of IO requests if possible (0 - don't merge) [0] # --file-rw-ratio=N reads/writes ratio for combined test [1.5]
testmodes=( "seqwr" "seqrewr" "seqrd" "rndrd" "rndwr" "rndrw" ) for testmode in "${testmodes[@]}" do directios=( "" "sync" "direct" "dsync" ) for directio in "${directios[@]}" do date echo 1 > /proc/sys/vm/drop_caches echo "begin to run $testmode $directio" sysbench fileio --file-num=$SYSBENCH_FILE_NUM --file-block-size=$SYSBENCH_BLOCK_SIZE --file-total-size=$SYSBENCH_FILE_TOTAL_SIZE --file-test-mode=$testmode --file-io-mode=sync --file-extra-flags=$directio --file-fsync-all=$FSYNC --file-fsync-mode=fsync --file-fsync-freq=0 --file-merged-requests=0 --threads=$SYSBENCH_NUM_THREADS prepare sysbench fileio --file-num=$SYSBENCH_FILE_NUM --file-block-size=$SYSBENCH_BLOCK_SIZE --file-total-size=$SYSBENCH_FILE_TOTAL_SIZE --file-test-mode=$testmode --file-io-mode=sync --file-extra-flags=$directio --file-fsync-all=$FSYNC --file-fsync-mode=fsync --file-fsync-freq=0 --file-merged-requests=0 --report-interval=10 --threads=$SYSBENCH_NUM_THREADS --time=$SYSBENCH_TIME run sysbench fileio --file-num=$SYSBENCH_FILE_NUM --file-block-size=$SYSBENCH_BLOCK_SIZE --file-total-size=$SYSBENCH_FILE_TOTAL_SIZE --file-test-mode=$testmode --file-io-mode=sync --file-extra-flags=$directio --file-fsync-all=$FSYNC --file-fsync-mode=fsync --file-fsync-freq=0 --file-merged-requests=0 cleanup date esynccho "Finish one loop test" done done