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

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

发布时间:2020-06-05 15:34:37

来源:51CTO

阅读:204

作者:三月

下文给大家带来关于使用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性能的操作步骤详细内容,是否有所收获。如果想要了解更多相关,可以继续关注我们的行业资讯板块。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值