mysql sysbench基准测试

git项目地址:

https://github.com/akopytov/sysbench

利用sysbench很容易对mysql做性能基准测试(当然这个工具很强大,除了测试主流数据库性能,还能测试其它方面,详情自己看官网项目文档)

Linux上的用法:

一、安装 

  yum install  -y sysbench

二、先在mysql上创建一个专门的测试数据库,比如sbtest

   FATAL: unable to connect to MySQL server, aborting...

FATAL: error 1049: Unknown database 'sbtest'
FATAL: failed to connect to database server!
...

错误提示说:mysql连接不上, sbtest库没找到。 需要创建一个sbtest库!

sysbench /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --db-driver=mysql  --mysql-host=192.168.60.165 --mysql-port=18604 --mysql-user=root --mysql-password=cc.123 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 prepare

三、利用sysbench先生成测试数据  

sysbench /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --db-driver=mysql  --mysql-host=192.168.60.165 --mysql-port=18604 --mysql-user=root --mysql-password=cc.123 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 run >> /home/mysysbench.log

猜你喜欢

转载自www.cnblogs.com/zping/p/9213172.html
今日推荐