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
--test=tests/db/oltp.lua 表示调用 tests/db/oltp.lua 脚本进行 oltp 模式测试
--oltp_tables_count=10 表示会生成 10 个测试表
--oltp-table-size=100000 表示每个测试表填充数据量为 100000
--rand-init=on 表示每个测试表都是用随机数据来填充的
真实测试场景中,数据表建议不低于10个,单表数据量不低于500万行,当然了,要视服务器硬件配置而定。如果是配备了SSD或者PCIE SSD这种高IOPS设备的话,则建议单表数据量最少不低于1亿行。
真实测试场景中,建议持续压测时长不小于30分钟,否则测试数据可能不具参考意义。
三、利用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
sysbench : multi-threaded system evaluation benchmark Running the test with following options:
Number of threads: 8
Report intermediate results every 10 second(s)
Random number generator seed is 0 and will be ignored Threads started!
-- 每10秒钟报告一次测试结果,tps、每秒读、每秒写、99%以上的响应时长统计
[ 10s] threads: 8, tps: 1111.51, reads/s: 15568.42, writes/s: 4446.13, response time: 9.95ms (99%)
[ 20s] threads: 8, tps: 1121.90, reads/s: 15709.62, writes/s: 4487.80, response time: 9.78ms (99%)
[ 30s] threads: 8, tps: 1120.00, reads/s: 15679.10, writes/s: 4480.20, response time: 9.84ms (99%)
[ 40s] threads: 8, tps: 1114.20, reads/s: 15599.39, writes/s: 4456.30, response time: 9.90ms (99%)
[ 50s] threads: 8, tps: 1114.00, reads/s: 15593.60, writes/s: 4456.70, response time: 9.84ms (99%)
[ 60s] threads: 8, tps: 1119.30, reads/s: 15671.60, writes/s: 4476.50, response time: 9.99ms (99%)
OLTP test statistics:
queries performed:
read: 938224 -- 读总数
write: 268064 -- 写总数
other: 134032 -- 其他操作总数(SELECT、INSERT、UPDATE、DELETE之外的操作,例如COMMIT等)
total: 1340320 -- 全部总数
transactions: 67016 (1116.83 per sec.) -- 总事务数(每秒事务数)
deadlocks: 0 (0.00 per sec.) -- 发生死锁总数
read/write requests: 1206288 (20103.01 per sec.) -- 读写总数(每秒读写次数)
other operations: 134032 (2233.67 per sec.) -- 其他操作总数(每秒其他操作次数) General statistics: -- 一些统计结果
total time: 60.0053s -- 总耗时
total number of events: 67016 -- 共发生多少事务数
total time taken by event execution: 479.8171s -- 所有事务耗时相加(不考虑并行因素)
response time: -- 响应时长统计
min: 4.27ms -- 最小耗时
avg: 7.16ms -- 平均耗时
max: 13.80ms -- 最长耗时
approx. 99 percentile: 9.88ms -- 超过99%平均耗时 Threads fairness:
events (avg/stddev): 8377.0000/44.33
execution time (avg/stddev): 59.9771/0.00
测试完成执行cleanup
测试结束后,记得执行cleanup,以确保测试所产生的文件都已删除
mysql sysbench基准测试的更多相关文章
- MySQL服务器基准测试
一.基准测试简介 1.什么是基准测试 数据库的基准测试是对数据库的性能指标进行定量的.可复现的.可对比的测试. 基准测试与压力测试 基准测试可以理解为针对系统的一种压力测试.但基准测试不关心业务逻辑, ...
- sysbench基准测试(2)——oltp.lua测试
前面知道sysbench基准测试的主要步骤为:prepare(准备数据集)→ run(运行测试)→ cleanup(清除数据集) 这一节介绍oltp.lua测试. oltp基准测试模拟了一个简单的事物 ...
- Sysbench对Mysql进行基准测试
前言 1.基准测试(benchmarking)是性能测试的一种类型,强调的是对一类测试对象的某些性能指标进行定量的.可复现.可对比的测试. 进一步来理解,基准测试是在某个时候通过基准测试建立一个已知的 ...
- 利用sysbench进行MySQL OLTP基准测试
Preface In order to know clearly about the real performance threshold of database server,we ...
- mysql benchmark基准测试
git项目地址: https://github.com/akopytov/sysbench 利用sysbench很容易对mysql做性能基准测试(当然这个工具很强大,除了测试主流数据库性能,还能测试其 ...
- MySQL性能基准测试对比:5.7 VS 8.0
本文由云+社区发表 作者:数据库 版权声明:本文由腾讯云数据库产品团队整理,页面原始内容来自于severalnines英文官网,若转载请注明出处.翻译目的在于传递更多全球最新数据库领域相关信息,并不意 ...
- 基于mysql的基准测试
常用的基准测试工具介绍: mysql基准测试工具: mysqlslap,mysql自带的工具,对于性能测试不建议使用 特点: 可以模拟服务器负载,并输出相关统计信息 可以指定也可以自动生成查询语句 常 ...
- sysbench基准测试工具
一.简介SysBench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.当前功能允许测试的系统参数有:file I/O performance (文件I ...
- sysbench基准测试工具使用
1.源码编译安装 源码下载地址(目前有0.4/0.5/1.0三个分支版本):https://github.com/akopytov/sysbench 编译安装: unzip sysbench-1.0. ...
随机推荐
- PowerDesigner 16PDM显示备注
默认显示的列是Name及类型 name和code不支持同时显示,设置方法: Tool->Model Options->Name Convention->右侧display中选择显示n ...
- PySide_Qt文档介绍
http://qt-project.org/wiki/PySideDocumentation/
- VBA字符串处理大全
https://blog.csdn.net/goldengod/article/details/73558537 VBA字符串处理大全-from EH http://club.excelhome.n ...
- Unity Editor工具-代码里复制Component
//CopyComponent ublic static T CopyComponent<T>(T original, GameObject destination) where T : ...
- 9.26/27 blog项目
2018-9-26 18:05:20 放上一个老男孩b站视频连接 :https://shimo.im/docs/VN0BLgAIBdMVSa4S/ b站连接: https://space.bilibi ...
- include_once与require_once的区别
①作用及用法 可以减少代码的重复 include(_once)("文件的路径")与require(_once)("文件的路径") ②理解 说白了,就是用包含进 ...
- TP5和TP3.2的区别
1.控制器输出 return $this->fetch("index/hello"); $this->display 单字母函数去掉了 如:M() D() U() S( ...
- 安装 powerline
使用说明: https://powerline.readthedocs.io/en/latest/usage.html ~ vim,在 .vimrc 中添加配置 set rtp+=/usr/lib/p ...
- Flask web开发之路一
之前学过一段时间的flask,感觉还是挺好用的,自己的专利挖掘项目也想这个web框架来搭建,于是重新开始基础学习 环境:win10,python3.6,pycharm2017,虚拟环境virtuale ...
- 单目三维稠密重建方案:Quadtree-accelerated Real-time Monocular Dense Mapping
论文:This is a monocular dense mapping system following the IEEE Robotics and Automation Letters (RA-L ...