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