Skip to content

Instantly share code, notes, and snippets.

@greyby
Last active March 27, 2020 03:03
Show Gist options
  • Save greyby/122dcd49ac938c0fbe17e07a16aeba10 to your computer and use it in GitHub Desktop.
Save greyby/122dcd49ac938c0fbe17e07a16aeba10 to your computer and use it in GitHub Desktop.
sysbench usage

$ sysbench --version sysbench 1.0.19

db-driver=mysql
mysql-host=127.0.0.1
mysql-port=3306
mysql-user=root
mysql-password=password
mysql-db=sysbench_test
mysql-socket=/tmp/mysql.sock
report-interval=1

CPU

sysbench cpu --threads=8 --time=60 --cpu-max-prime=20000 run

Memory

sysbench memory --threads=8 --memory-block-size=16k --memory-total-size=100G --memory-oper=write run

Disk I/O

sysbench fileio --threads=16 --file-num=10 --file-total-size=150G --file-test-mode=rndrw --file-extra-flags=direct prepare
sysbench fileio --threads=16 --file-num=10 --file-total-size=150G --file-test-mode=rndrw --file-extra-flags=direct --time=300 run
sysbench fileio --threads=16 --file-total-size=150G --file-test-mode=rndrw cleanup

Read Only

nohup sysbench --config-file=config oltp_read_only --tables=10 --table-size=10000000 --threads=56 prepare > out1.log 2>&1 &
sysbench --config-file=config oltp_read_only --tables=10 --table-size=10000000 --threads=56 --events=0 --time=300 run > sysbench.log
sysbench --config-file=config oltp_read_only --tables=10 --table-size=10000000 --threads=56 --events=0 --time=300 cleanup

Read and Write

nohup sysbench --config-file=config oltp_read_write --tables=10 --table-size=10000000 --threads=56 prepare > out.log 2>&1 &
sysbench --config-file=config oltp_read_write --tables=10 --table-size=10000000 --threads=56 --events=0 --time=300 run > sysbench.log
sysbench --config-file=config oltp_read_write --tables=10 --table-size=10000000 --threads=56 --events=0 --time=300 cleanup

Thread

sysbench threads --threads=500 --thread-yields=100 --thread-locks=4 run

mutex

sysbench mutex --threads=100 --mutex-num=1000 --mutex-locks=100000 --mutex-loops=10000 run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment