sysbench測試mysql性能

sysbench測試mysql性能:

安裝sysbench 1.0:

apt-get install bzr automake libtool libmysqlclient-dev pkg-config unzip

ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.14 /usr/lib/libmysqlclient_r.so

wget https://github.com/akopytov/sysbench/archive/1.0.zip -O "sysbench-1.0.zip"

unzip sysbench-1.0.zip

cd sysbench-1.0

./autogen.sh

./configure

make && make install

1.0的oltp.lua路徑爲--test=./sysbench-1.0/tests/include/oltp_legacy/oltp.lua

file I/O performance (文件I/O性能)
scheduler performance (調度性能)
memory allocation and transfer speed (內存分配和傳輸速度)
POSIX threads implementation performance (POSIX線程執行績效)
database server performance (OLTP benchmark)(數據庫服務器性能)

測試CPU:

/usr/local/bin/sysbench --test=cpu --cpu-max-prime=2000 --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx run

測試線程:

/usr/local/bin/sysbench --test=threads --num-threads=500 --thread-yields=100 --thread-lock=4 --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx run

測試IO:

準備:

/usr/local/bin/sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx prepare

測試:

/usr/local/bin/sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx run

清理:

/usr/local/bin/sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx cleanup

測試內存:

/usr/local/bin/sysbench --test=memory --memory-block-size=8k --memory-total-size=1G --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx run

測試mutex(互斥性能測試):

/usr/local/bin/sysbench --test=mutex --num-threads=100 --mutex-num=100 --mutex-locks=100000 --mutex-loops=10000 --mysql-host=10.0.1.5 --mysql-db=ming --mysql-user=ming --mysql-password=xxxxx run

測試OLTP(數據庫服務器性能):

準備:

/usr/local/bin/sysbench --test=./sysbench-1.0/tests/include/oltp_legacy/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --oltp-test-mode=complex --oltp-table-size=10 --threads=10 --mysql-user=ming --mysql-password=xxxxx prepare

只讀測試:

/usr/local/bin/sysbench --test=./sysbench-1.0/tests/include/oltp_legacy/oltp_simple.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --oltp-test-mode=simple --oltp-table-size=10 --threads=10 --mysql-user=ming --mysql-password=xxxx run

讀寫混合測試:

/usr/local/bin/sysbench --test=./sysbench-1.0/tests/include/oltp_legacy/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --oltp-test-mode=complex --oltp-table-size=10 --threads=10 --mysql-user=ming --mysql-password=xxxx run

清理:

/usr/local/bin/sysbench --test=./sysbench-1.0/tests/include/oltp_legacy/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --oltp-test-mode=complex --oltp-table-size=10 --threads=10 --mysql-user=ming --mysql-password=xxxx cleanup

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章