温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-06-05 15:34:37 来源:网络 阅读:646 作者:三月 栏目:系统运维

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

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI