设为首页 加入收藏

TOP

mysql压力测试之sysbench 安装、使用和测试(五)
2017-11-15 09:15:27 】 浏览:465
Tags:mysql 压力 测试 sysbench 安装 使用
/io# sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw run sysbench 0.4.12: multi-threaded system eva luation benchmark Running the test with following options: Number of threads: 20 Extra file open flags: 0 128 files, 16Mb each 2Gb total file size Block size 16Kb Number of random requests for random IO: 10000 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random r/w test Threads started! Done. Operations performed: 6010 Read, 3997 Write, 12803 Other = 22810 Total Read 93.906Mb Written 62.453Mb Total transferred 156.36Mb (6.6668Mb/sec) 426.68 Requests/sec executed Test execution summary: total time: 23.4534s total number of events: 10007 total time taken by event execution: 111.5569 per-request statistics: min: 0.01ms avg: 11.15ms max: 496.18ms approx. 95 percentile: 53.05ms Threads fairness: events (avg/stddev): 500.3500/37.50 execution time (avg/stddev): 5.5778/0.21 root@db2:~/io# sysbench --test=fileio --num-threads=20 --file-total-size=2G --file-test-mode=rndrw cleanup sysbench 0.4.12: multi-threaded system eva luation benchmark Removing test files...

4)测试内存:sysbench --test=memory --memory-block-size=8k --memory-total-size=1G run

\
sysbench 0.4.12:  multi-threaded system eva luation benchmark
Operations performed: 1310720 (396525.32 ops/sec)
10240.00 MB transferred (3097.85 MB/sec)
Test execution summary:
total time:                          3.3055s
total number of events:              1310720
total time taken by event execution: 205.0560
per-request statistics:
min:                                  0.00ms
avg:                                  0.16ms
max:                               1066.04ms
approx.  95 percentile:               0.02ms
Threads fairness:
events (avg/stddev):           13107.2000/3870.38
execution time (avg/stddev):   2.0506/0.28

5)测试mutex:sysbench –test=mutex –num-threads=100 –mutex-num=1000 –mutex-locks=100000 –mutex-loops=10000 run

\
Test execution summary:
total time:                          12.5606s
total number of events:              100
total time taken by event execution: 1164.4236
per-request statistics:
min:                               9551.87ms
avg:                              11644.24ms
max:                              12525.32ms
approx.  95 percentile:           12326.25ms
Threads fairness:
events (avg/stddev):           1.0000/0.00
execution time (avg/stddev):   11.6442/0.59

6)测试OLTP:
1,prepare阶段,生成需要的测试表

这里要注意host的填写*(我在本地测试的,写的是127.0.0.1)
sysbench --test=oltp --mysql-table-engine=innodb --mysql-host=127.0.0.1 --mysql-db=test --oltp-table-size=500000 --mysql-user=root --mysql-password=123456 prepare
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 run
3,清理测试时生成的测试表
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

root@db2:~# sysbench --test=oltp --mysql-table-engine=innodb --mysql-host=192.168.x.x --mysql-db=rep_test --oltp-table-size=1000000 --mysql-user=root --mysql-password=123456 prepare
sysbench 0.4.12:  multi-threaded system eva luation benchmark

No DB drivers specified, using mysql
Creating table 'sbtest'...
Creating 1000000 records in table 'sbtest
首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇DML与DDL查询语言介绍 下一篇Docker 容器的常规用法详情

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目