Skip to content

Instantly share code, notes, and snippets.

@gmatheu
Last active March 1, 2017 00:57
Show Gist options
  • Save gmatheu/6a9568853fb4a9c70ff3 to your computer and use it in GitHub Desktop.
Save gmatheu/6a9568853fb4a9c70ff3 to your computer and use it in GitHub Desktop.
benchmark
# https://wiki.mikejung.biz/Benchmarking#How_to_Break_In_an_SSD_before_Benchmarking
#--filename=$block_dev
echo "FIO randwrite"
fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=0 --size=1024M \
--numjobs=8 --runtime=240 --group_reporting --output-format=json > fio-randwrite.json;
echo "FIO randread"
fio --name=randread --ioengine=libaio --iodepth=16 --rw=randread --bs=4k --direct=0 --size=1024M \
--numjobs=8 --runtime=240 --group_reporting --output-format=json > fio-randread.json;
rm *.0
echo "sysbench memory read"
sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=100G \
--memory-oper=read run > sysbench-memory-read.out
echo "sysbench memory write"
sysbench --test=memory --memory-block-size=1K --memory-scope=global --memory-total-size=100G \
--memory-oper=write run > sysbench-memory-write.out
for each in 1 2 4 8 16;
do
echo "sysbench cpu: $each"
sysbench --test=cpu --cpu-max-prime=20000 --num-threads=$each run > sysbench-cpu-$each.out;
done
echo "sysbench fileio prepare"
sysbench --test=fileio --file-total-size=8G --file-num=64 prepare
thread=8
run=1
echo "sysbench fileio rndwr ${thread} threads"
sysbench --test=fileio --file-total-size=8G --file-test-mode=rndwr --max-time=60 --max-requests=0 \
--file-block-size=4K --file-num=64 --num-threads=${thread} run > sysbench-fileio-rndwr_${thread}T-${run}.out
echo "sysbench fileio rndrd ${thread} threads"
sysbench --test=fileio --file-total-size=8G --file-test-mode=rndrd --max-time=60 --max-requests=0 \
--file-block-size=4K --file-num=64 --num-threads=${thread} run > sysbench-fileio-rndrd_${thread}T-${run}.out
echo "sysbench fileio cleanup"
sysbench --test=fileio --file-total-size=8G --file-num=64 cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment