--oltp-dist-type=STRING 分布的随机数{uniform(平均分布),Gaussian(高斯分布),special(空间分布)}。默认是special
--oltp-dist-iter=N 产生数的迭代次数。默认是12
--oltp-dist-res=N ‘special’的百分比值。默认是75
General database options:
--db-ps-mode=STRING编制报表应用模式{auto, disable} [auto]
--max-time=N limit for total execution time in seconds [0] #最大年夜履行时光,单位是s。默认是0,不限制。
Compiled-in database drivers:
--oltp-index-updates=N number of index update [1]
- mysql - MySQL driver
mysql options:
--mysql-host=[LIST,...] MySQL server host [localhost]
--mysql-port=N MySQL server port [3306]
--mysql-socket=STRING MySQL socket
--mysql-user=STRING MySQL user [sbtest]
--mysql-password=STRING MySQL password []
--mysql-db=STRING MySQL database name [sbtest]
--mysql-table-engine=STRING storage engine to use for the test table {myisam,innodb,bdb,heap,ndbcluster,federated} [innodb]
--mysql-engine-trx=STRING whether storage engine used is transactional or not {yes,no,auto} [auto]
--mysql-ssl=[on|off] use SSL connections, if available in the client library [off]
--myisam-max-rows=N max-rows parameter for MyISAM tables [1000000]
3.测试线程
- sysbench --test=threads --num-threads=500 --thread-yields=100 --thread-locks=4 run
4.测试IO
- sysbench --test=oltp --mysql-table-engine=innodb --mysql-host=192.168.X.X --mysql-db=test --oltp-table-size=500000 --mysql-user=root --mysql-password=123456 prepare
--num-threads 开启的线程 --file-total-size 总的文件大年夜小
1,prepare阶段,生成须要的测试文件,完成后会在当前目次下生成很多小文件。
- sysbench --test=fileio --num-threads=16 --file-total-size=2G --file-test-mode=rndrw prepare
下面的敕令运行文件 I/O 混淆随机读/写基准测试:
- sysbench --test=fileio --file-total-size=3G --file-test-mode=rndrw --max-time=300 --max-requests=0 run
Ubuntu体系可以直接apt,如:
履行结不雅:
输出结不雅分析:
每秒请求数是:233.33 Requests/sec
吞吐量是:3.6458Mb/sec
- sysbench --test=fileio --file-total-size=3G cleanup
5.清理测试时生成的文件
- sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw cleanup
6.测试内存
- sysbench --test=memory --memory-block-size=8k --memory-total-size=1G run
7.测试mutex
- sysbench –test=mutex –num-threads=100 –mutex-num=1000 –mutex-locks=100000 –mutex-loops=10000 run
8.测试OLTP
1,prepare阶段,生成须要的测试表
- sysbench --num-threads=16 --test=oltp --mysql-table-engine=innodb --mysql-host=192.168.x.x --mysql-db=test --oltp-table-size=500000 --mysql-user=root --mysql-password=123456 run
3,清理测试时生成的测试表
2,run阶段
- sysbench --num-threads=16 --test=oltp --mysql-table-engine=innodb --mysql-host=192.168.x.x --mysql-db=test --oltp-table-size=500000 --mysql-user=root --mysql-password=123456 cleanup
推荐阅读
室外持续高温,王金升正舒畅地在空调房享受着这一消暑时刻,忽然他放在桌子上的手机“滴滴”地响了起来,他经由过程简单的操作,就完成了自家地里的举措措施大年夜棚的┞菲握。>>>详细阅读
本文标题:MySQL高性能学习笔记
地址:http://www.17bianji.com/lsqh/36585.html
1/2 1