欢迎光临
我们一直在努力

使用sysbench测试mysql性能的操作步骤

下文给大家带来关于使用sysbench测试mysql性能的操作步骤,感兴趣的话就一起来看看这篇文章吧,相信看完使用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 –threads=500 –mysql-host=10.0.1.5 –mysql-db=ming –mysql-user=ming –mysql-password=xxxxx run

测试IO:

准备:

/usr/local/bin/sysbench –test=fileio –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 –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 –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

看了以上关于使用sysbench测试mysql性能的操作步骤详细内容,是否有所收获。如果想要了解更多相关,可以继续关注我们的行业资讯板块。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。