Disk Performance Testing

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.

Preparation

Test script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

SYSBENCH_FILE_TOTAL_SIZE=16G
SYSBENCH_FILE_NUM=16
SYSBENCH_NUM_THREADS=16
FSYNC=off
SYSBENCH_BLOCK_SIZE=4096
SYSBENCH_TIME=60

# --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

rm -rf test_file.*

echo "Finish all test"