当前位置:Gxlcms > 数据库问题 > sysbench测试mysql性能

sysbench测试mysql性能

时间:2021-07-01 10:21:17 帮助过:23人阅读

sysbench测试mysql性能:

安装 sysbench 0.5:

apt-get install bzr automake libtool libmysqlclient-dev

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

bzr branch lp:sysbench

cd sysbench/

./autogen.sh

./configure

make && make install

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/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --mysql-user=ming --mysql-password=xxxxx prepare

测试:

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

清理:

/usr/local/bin/sysbench --test=./sysbench/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --mysql-user=ming --mysql-password=xxxx cleanup

sysbench测试mysql性能

标签:password   sysbench   inux   ibm   imp   oge   reads   oop   x86_64   

人气教程排行