Preparing benchmarks for disks

For more accurate results, we recommend tuning the following parameters in the fio scripts listed below:

  • size is 4G by default, but can be set to twice the node’s RAM divided by the node’s CPU cores.
  • numjobs is the number of CPU cores divided by 2 for an HDD, or the number of CPU cores for an SSD.
  • iodepth is set to 2 or 4 for an HDD, or to 32 for an SSD.

Save the following scripts with the suggested filename on each node:

fio.write.single.randwrite
[job]
blocksize=4k
rw=randwrite
direct=1
buffered=0
ioengine=libaio
iodepth=32
fdatasync=32
size=8G
numjobs=16
fio.write.single.seqwrite
[job]
blocksize=1m
rw=write
direct=1
buffered=0
ioengine=libaio
iodepth=32
fdatasync=32
size=8G
numjobs=16
fio.write.all
[job]
blocksize=4k
rw=randwrite
direct=1
buffered=0
ioengine=libaio
iodepth=32
fdatasync=32
size=8G
numjobs=16
fio.read.random
[job]
blocksize=4k
rw=randread
direct=1
buffered=0
ioengine=libaio
iodepth=32
fdatasync=32
size=8g
numjobs=16
fio.write.random
[job]
blocksize=4k
rw=randwrite
direct=1
buffered=0
ioengine=libaio
iodepth=32
fdatasync=32
size=8g
numjobs=16
fio.read.seq
[job]
blocksize=1m
rw=read
direct=1
buffered=0
ioengine=libaio
iodepth=16
fdatasync=32
size=8g
numjobs=16
fio.write.seq
[job]
blocksize=1m
rw=write
direct=1
buffered=0
ioengine=libaio
iodepth=16
fdatasync=32
size=8g
numjobs=16
cs_write_test.sh
#!/bin/sh
 
cs_mounts=$(vstorage -c $(cat /mnt/vstorage/.vstorage.info/clustername) list-services | grep vstorage.*cs | awk '{print$NF}' )
fio_config="$1"
 
for d in $cs_mounts; do
        cs=`cat $d/control/id`
        echo "Testing $cs in $d..."
        test_dir="$(dirname $d)/test"
        mkdir $test_dir
        f=$test_dir/file
        log_file="$cs.$fio_config.log"
        fio --group_reporting --filename=$f $fio_config > $log_file
        result=`grep "write:" $log_file`
        echo $result
        rm -f $f
        rmdir $test_dir
done
cs_all_write_test.sh
#!/bin/sh
 
cs_mounts=$(vstorage -c $(cat /mnt/vstorage/.vstorage.info/clustername) list-services | grep vstorage.*cs | awk '{print$NF}' )
fio_config="$1"
 
echo "Test drives simultaneously..."
filenames=""
log_file="$fio_config.log"
 
for d in $cs_mounts; do
        cs=`cat $d/control/id`
        test_dir="$(dirname $d)/test"
        mkdir $test_dir
        f=$test_dir/file
        path="--filename=$f"
        filenames="$filenames $path"
done
 
fio --group_reporting $filenames $fio_config > $log_file
result=`grep "write:" $log_file`
echo $result
 
for d in $cs_mounts; do
        test_dir="$(dirname $d)/test"
        f=$test_dir/file
#       echo "Cleaning $f ..."
        rm -f $f
        rmdir $test_dir
done
storage_test.sh
#!/bin/sh
 
fio_config="$1"
log_file="$(hostname).$fio_config.log"
 
test_dir="/mnt/vstorage/test/$(hostname)"
f="$test_dir/file"
 
mkdir -p $test_dir
echo "Testing in $f ..."
fio --group_reporting --filename=$f $fio_config > $log_file
 
result=`egrep "read:|write:" $log_file`
echo $result
 
rm -f $f
rmdir $test_dir