ref

测试

当执行下面这个sysbench测试mysql的时候,你不知道的可能可能是:

这到底是在测试读写?还是 读? 答: 只读

--num-threads=12 啥意思? 答:就是说有12个线程在同时链接

你可以看到:这是在创建 表

Creating table 'sbtest1'...

Inserting 500000 records into 'sbtest1'

Creating table 'sbtest2'...

Inserting 500000 records into 'sbtest2'

Creating table 'sbtest3'...

..

..

..

而接下来,才是你测试的过程,你设置--max-time=120 就是说测试120s

sysbench --test=/tmp/sysbench/sysbench-0.4.12-1.1/sysbench/tests/db/oltp.lua \

--mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root \

--mysql-db=sbtest --oltp-tables-count=10 --oltp-table-size=500000 \

--report-interval=10 --oltp-dist-type=uniform --rand-init=on --max-requests=0 \

--oltp-read-only=on --oltp-skip-trx=on \

--max-time=120 --num-threads=12 prepare

[root@jiangyi01.sqa.zmf /home/ahao.mah/ALIOS_QA/tools]

#sh sysbench/sysbench_mysql.sh -d

mysql -h127.0.0.1 -P3306 -uroot

create database sbtest

sysbench 0.5: multi-threaded system evaluation benchmark

Creating table 'sbtest1'...

Inserting 500000 records into 'sbtest1'

Creating table 'sbtest2'...

Inserting 500000 records into 'sbtest2'

Creating table 'sbtest3'...

Inserting 500000 records into 'sbtest3'

Creating table 'sbtest4'...

Inserting 500000 records into 'sbtest4'

Creating table 'sbtest5'...

Inserting 500000 records into 'sbtest5'

Creating table 'sbtest6'...

Inserting 500000 records into 'sbtest6'

Creating table 'sbtest7'...

Inserting 500000 records into 'sbtest7'

Creating table 'sbtest8'...

Inserting 500000 records into 'sbtest8'

Creating table 'sbtest9'...

Inserting 500000 records into 'sbtest9'

Creating table 'sbtest10'...

Inserting 500000 records into 'sbtest10'

sysbench 0.5: multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 12

Report intermediate results every 10 second(s)

Initializing random number generator from timer.

Random number generator seed is 0 and will be ignored

Threads started!

[ 10s] threads: 12, tps: 0.00, reads/s: 50022.15, writes/s: 0.00, response time: 3.90ms (95%)

[ 20s] threads: 12, tps: 0.00, reads/s: 54988.13, writes/s: 0.00, response time: 3.74ms (95%)

[ 30s] threads: 12, tps: 0.00, reads/s: 54559.99, writes/s: 0.00, response time: 3.79ms (95%)

[ 40s] threads: 12, tps: 0.00, reads/s: 55341.59, writes/s: 0.00, response time: 3.65ms (95%)

[ 50s] threads: 12, tps: 0.00, reads/s: 55481.02, writes/s: 0.00, response time: 3.65ms (95%)

[ 60s] threads: 12, tps: 0.00, reads/s: 55929.09, writes/s: 0.00, response time: 3.56ms (95%)

[ 70s] threads: 12, tps: 0.00, reads/s: 55855.21, writes/s: 0.00, response time: 3.63ms (95%)

[ 80s] threads: 12, tps: 0.00, reads/s: 55590.89, writes/s: 0.00, response time: 3.62ms (95%)

[ 90s] threads: 12, tps: 0.00, reads/s: 55348.11, writes/s: 0.00, response time: 3.68ms (95%)

[ 100s] threads: 12, tps: 0.00, reads/s: 55783.70, writes/s: 0.00, response time: 3.62ms (95%)

[ 110s] threads: 12, tps: 0.00, reads/s: 55622.30, writes/s: 0.00, response time: 3.66ms (95%)

[ 120s] threads: 12, tps: 0.00, reads/s: 55634.92, writes/s: 0.00, response time: 3.64ms (95%)

OLTP test statistics:

queries performed:

read: 6601616

write: 0

other: 0

total: 6601616

transactions: 0 (0.00 per sec.)

deadlocks: 0 (0.00 per sec.)

read/write requests: 6601616 (55012.22 per sec.)

other operations: 0 (0.00 per sec.)

General statistics:

total time: 120.0027s

total number of events: 471544

total time taken by event execution: 1439.0586s

response time:

min: 2.20ms

avg: 3.05ms

max: 260.74ms

approx. 95 percentile: 3.69ms

Threads fairness:

events (avg/stddev): 39295.3333/1154.93

execution time (avg/stddev): 119.9215/0.00

[root@jiangyi01.sqa.zmf /home/ahao.mah]

#top -Hp 3997

混合读写

读写测试还是用oltp.lua,只需把--oltp-read-only等于off。

只更新

如果基准测试的时候,你只想比较两个项目的update(或insert)效率,那可以不使用oltp脚本,而直接改用update_index.lua:

./bin/sysbench --test=./share/tests/db/update_index.lua \

--mysql-host=10.0.201.36 --mysql-port=8066 --mysql-user=ecuser --mysql-password=ecuser \

--mysql-db=dbtest1a --oltp-tables-count=10 --oltp-table-size=500000 \

--report-interval=10 --rand-init=on --max-requests=0 \

--oltp-read-only=off --max-time=120 --num-threads=128 \

[ prepare | run | cleanup ]

此时像oltp-read-only=off许多参数都失效了。需要说明的是这里 (非)索引更新,不是where条件根据索引去查找更新,而是更新索引列上的值。

结果解读

sysbench 0.5: multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 128

Report intermediate results every 20 second(s)

Initializing random number generator from timer.

Random number generator seed is 0 and will be ignored

Initializing worker threads...

Threads started!

[ 20s] threads: 128, tps: 2354.54, reads: 33035.89, writes: 9423.39, response time: 66.80ms (95%), errors: 0.00, reconnects: 0.00

[ 40s] threads: 128, tps: 2377.75, reads: 33274.26, writes: 9507.55, response time: 66.88ms (95%), errors: 0.00, reconnects: 0.00

[ 60s] threads: 128, tps: 2401.35, reads: 33615.30, writes: 9607.40, response time: 66.40ms (95%), errors: 0.00, reconnects: 0.00

[ 80s] threads: 128, tps: 2381.20, reads: 33331.50, writes: 9522.55, response time: 67.30ms (95%), errors: 0.00, reconnects: 0.00

[ 100s] threads: 128, tps: 2388.85, reads: 33446.10, writes: 9556.35, response time: 67.00ms (95%), errors: 0.00, reconnects: 0.00

[ 120s] threads: 128, tps: 2386.40, reads: 33421.35, writes: 9545.35, response time: 66.94ms (95%), errors: 0.00, reconnects: 0.00

OLTP test statistics:

queries performed:

read: 4003048 //总select数量

write: 1143728 //总update、insert、delete语句数量

other: 571864 //commit、unlock tables以及其他mutex的数量

total: 5718640

transactions: 285932 (2382.10 per sec.) //通常需要关注的数字(TPS)

read/write requests: 5146776 (42877.85 per sec.)

other operations: 571864 (4764.21 per sec.)

ignored errors: 0 (0.00 per sec.) //忽略的错误数

reconnects: 0 (0.00 per sec.)

General statistics:

total time: 120.0334s //即max-time指定的压测实际

total number of events: 285932 //总的事件数,一般与transactions相同

total time taken by event execution: 15362.6623s

response time:

min: 17.60ms

avg: 53.73ms //95%的语句的平均响应时间

max: 252.90ms

approx. 95 percentile: 66.88ms

Threads fairness:

events (avg/stddev): 2233.8438/9.04

execution time (avg/stddev): 120.0208/0.01

我们一般关注的用于绘图的指标主要有:

response time avg: 平均响应时间。(后面的95%的大小可以通过--percentile=98的方式去更改)

transactions: 精确的说是这一项后面的TPS 。但如果使用了-oltp-skip-trx=on,这项事务数恒为0,需要用total number of events 去除以总时间,得到tps(其实还可以分为读tps和写tps)

read/write requests: 用它除以总时间,得到吞吐量QPS

当然还有一些系统层面的cpu,io,mem相关指标

sysbench还可以对文件系统IO测试,CPU性能测试,以及内存分配与传输速度测试,这里就不介绍了。

总结起来sysbench的缺点就是,模拟的表结构太简单,不像tpcc-mysql那样完整的事务系统。但对于性能压测对比还是很有用的,因为sysbench使用的环境参数限制是一样的。

sysbench mysql图表_sysbench_mysql相关推荐

  1. sysbench mysql 结果_sysbench使用和结果说明

    博客文章除注明转载外,均为原创.线程性能测试工具,作为dba的进行基准测试的必备经典工具,可以 执行以下测试 fileio - 文件 I/O测试 cpu - CPU系能测试 memory - 内存功能 ...

  2. sysbench mysql测试_使用sysbench对MySQL进行测试

    为什么要测试,测什么东西? 测试的种类非常多,测试的目的也非常多,我这里主要的目的就两个 测试MySQL的极限IO 对比不同版本MySQL,不同参数, 不同硬件,不同系统对MySQL的性能影响 为什么 ...

  3. sysbench mysql oltp_用sysbench进行数据库OLTP基准测试

    基于TPC-C的OLTP基准测试,对比Mysql和PostgreSQL的性能 一.什么是TPC-C和tpmC 1.TPC-C TPC-C是一种旨在衡量联机事务处理(OLTP)系统性能与可伸缩性的行业标 ...

  4. sysbench mysql 测试_sysbench MySQL测试例子

    sysbench 测试 MySQL数据库 sysbench的oltp脚本 初始化数据 sysbench --test=oltp --num-threads=64 --max-requests=1024 ...

  5. sysbench mysql测试_用sysbench测试mysql和服务器性能

    关于sysbench测试步骤 关于sysbench调试和安装请参考: http://blog.chinaunix.net/uid-20682026-id-3138466.html 下载地址: [roo ...

  6. sysbench mysql oltp_sysbench测试mysql oltp

    以前在做mysql压力测试的时候用的是jmeter,jmeter配置有点烦,最近尝试用sysbench来进行mysql的压力测试 下载最新版的sysbench cd /usr/local/src wg ...

  7. sysbench mysql oltp_sysbench OLTP基准测试

    1.sysbench参数 # 通过参数 --num-threads=N           创建测试线程的数目.默认为1. --max-requests=N          请求的最大数目.默认为1 ...

  8. mysql front 图表,MySQL图表数据统计常用方法

    常用时间函数 NOW()当前时间.CURDATE()当前日期.CURTIME()当前时间 SELECT NOW(),CURDATE(),CURTIME(); >2019-03-22 10:20: ...

  9. sysbench tpcc-mysql_使用sysbench来测试MySQL性能的详细教程

    sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况. 目前sysbench代码托管在launchpad上,项目地址:https://laun ...

最新文章

  1. 浅谈 javascript 中的this绑定问题
  2. FPGA之道(82)功能仿真之仿真原理
  3. FreeBSD 8.0候选版本RC3发布
  4. oracle 一致性读数量,ORACLE 一致性读原理记录
  5. 3.4 参数展开-机器学习笔记-斯坦福吴恩达教授
  6. 成功解决softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be
  7. Spring中注解大全和应用
  8. 电池技术多年没有较大发展,成为移动设备最大制约
  9. 【转】1.4 Magento2语法讲解
  10. 在组件中获取Application
  11. python 个人项目_软工个人项目WC(Python实现)
  12. [数据][xml格式] 2012年统计用区划代码和城乡划分代码
  13. 我的科幻评论——《星船伞兵》:海因莱茵最经典又最不典型之作,平凡人类勇气与责任的赞歌
  14. 01 - Kali笔记_Linux_Kali环境熟悉
  15. 《ElasticSearch技术解析与实战-朱林》
  16. appcan中的微信分享与qq分享
  17. 应用商店调研-360手机助手
  18. CC++编程环境搭建-四种常用开发工具(VSCode,Dev,CodeBlocks,Clion)
  19. AutoLayout2
  20. 基于机器学习的时序数据预测方法

热门文章

  1. 使用echarts百度地图个性定制不生效
  2. C语言编程绘制一元二次函数,c语言怎么画出一元二次函数图像
  3. 相机内参矩阵K和fov的相互转换
  4. .Net(C#)汉字和Unicode编码互相转换
  5. 关于 resultType 与 parameterType 的基本使用的区别
  6. 工作中git常用命令总结
  7. js几种常见的递归方法
  8. [Mysql] LENGTH函数
  9. [Android6.0]App中调用init.rc中的服务,从而运行shell脚本
  10. 重生之学好C的第一天