sysbench基准测试(2)——oltp.lua测试
前面知道sysbench基准测试的主要步骤为:prepare(准备数据集)→ run(运行测试)→ cleanup(清除数据集)
这一节介绍oltp.lua测试。
oltp基准测试模拟了一个简单的事物处理系统的工作负载。
①、准备数据集(使用test数据库,用户名root,密码123456,表数目8,每张表记录10万,测试oltp.lua):
[root@localhost db]# sysbench --test=oltp.lua --mysql-db=test --mysql-user=root --mysql-password=123456 --oltp-tables-count=8 --oltp-table-size=100000 prepare
对选项作如下说明:
--test=oltp.lua //测试用的lua脚本,可以使用绝对路径。该脚本位于sysbench源码包的“sysbench-1.0/sysbench/tests/db/”文件夹下面。当然,你也可以自己写lua脚本。
--mysql-db=test //测试数据库
--mysql-user=root //用户名
--myssql-password=123456 //密码
--oltp-tables-count=8 //数据表
--oltp-table-size=100000 //每张表记录为10万
执行结果是:在test数据库中创建8张表,表名分别为“sbtest1...8”,每张表中有记录10万条。
②、执行oltp基础测试(线程数10,最大执行时间60s,只读off,打印信息间隔10s):
[root@localhost db]# sysbench --test=oltp.lua --mysql-db=test --mysql-user=root --mysql-password=123456 \
--oltp-tables-count=8 --oltp-table-size=100000 --num-threads=10 --max-time=60 --report-interval=10 --oltp-read-only=off run
对选项作如下说明:
--num-threads=10 //线程数为10
--max-time=60 //测试时间为60s
--report-interval=10 //报告打印周期为10s
--oltp-read-only=off //非只读操作测试
运行结果如下:
sysbench 1.0: multi-threaded system evaluation benchmark
Running the test with following options: //测试属性,可以通过选项设定
Number of threads: 10
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
//每10秒钟报告一次测试结果,tps、每秒读、每秒写、99%以上的响应时长统计
[ 10s] threads: 10, tps: 81.24, reads: 1149.41, writes: 325.75, response time: 280.29ms (95%), errors: 0.00, reconnects: 0.00
[ 20s] threads: 10, tps: 72.20, reads: 1012.70, writes: 292.00, response time: 318.42ms (95%), errors: 0.00, reconnects: 0.00
[ 30s] threads: 10, tps: 79.40, reads: 1111.60, writes: 317.60, response time: 284.35ms (95%), errors: 0.00, reconnects: 0.00
[ 40s] threads: 10, tps: 74.00, reads: 1034.59, writes: 295.60, response time: 350.64ms (95%), errors: 0.00, reconnects: 0.00
[ 50s] threads: 10, tps: 80.90, reads: 1127.81, writes: 320.90, response time: 309.40ms (95%), errors: 0.10, reconnects: 0.00
[ 60s] threads: 10, tps: 79.90, reads: 1126.20, writes: 322.80, response time: 309.03ms (95%), errors: 0.00, reconnects: 0.00
OLTP test statistics:
queries performed: //性能统计
read: 65632 //读总数,select语句
write: 18749 //写总数,insert、delete、update语句
other: 9375 //其它语句,如commit等
total: 93756 //总的执行语句数
transactions: 4687 (78.06 per sec.) //总的事物数(每秒处理事物数)
read/write requests: 84381 (1405.28 per sec.) //读写请求次数(每秒的读写次数)
other operations: 9375 (156.13 per sec.) //其它操作的每秒执行数
ignored errors: 1 (0.02 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 60.0456s //总时间
total number of events: 4687 //事物总数
total time taken by event execution: 600.0783s //所有事务耗时相加(不考虑并行因素)
response time: //应答时间
min: 31.96ms //最小
avg: 128.03ms //平均
max: 690.49ms //最大
approx. 95 percentile: 317.65ms //95%语句执行时间
Threads fairness: //线程公平性
events (avg/stddev): 468.7000/5.04
execution time (avg/stddev): 60.0078/0.01
最重要的参数指标:
总的事物数,每秒事务数,时间统计信息(最大、最小、平均、95%以上语句响应时间)
③、删除测试数据集
[root@localhost db]# sysbench --test=oltp.lua --mysql-db=test --mysql-user=root --mysql-password=123456 --oltp-tables-count=8 --oltp-table-size=100000 cleanup
后续:
这里的测试使用的是sysbench自带的oltp.lua脚本。也可以写自己的lua脚本来做相关测试。呃,可是lua不会...
sysbench基准测试(2)——oltp.lua测试的更多相关文章
- 使用sysbench 进行msyql oltp压力测试
安装参考: https://github.com/akopytov/sysbench#linux#参数说明 需要说明的选项: mysql-db=dbtest1a:测试使用的目标数据库,这个库名要事先创 ...
- sysbench 0.5 oltp测试笔记
sysbench 0.5相比0.4版本的主要变化是,oltp测试结合了lua脚本,不需要修改源码,通过自定义lua脚本就可以实现不同业务类型的测试.同时0.5相比0.4需要消耗更多的cpu资源. 1. ...
- sysbench 安装、使用和测试
摘要: sysbench是一个开源的.模块化的.跨平台的多线程性能测试工具,可以用来进行CPU.内存.磁盘I/O.线程.数据库的性能测试.目前支持的数据库有MySQL.Oracle和Post ...
- Mysql多线程性能测试工具sysbench 安装、使用和测试
From:http://www.cnblogs.com/zhoujinyi/archive/2013/04/19/3029134.html 摘要: sysbench是一个开源的.模块化的.跨 ...
- mysql sysbench基准测试
git项目地址: https://github.com/akopytov/sysbench 利用sysbench很容易对mysql做性能基准测试(当然这个工具很强大,除了测试主流数据库性能,还能测试其 ...
- 利用sysbench进行MySQL OLTP基准测试
Preface In order to know clearly about the real performance threshold of database server,we ...
- sysbench基准测试工具
一.简介SysBench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.当前功能允许测试的系统参数有:file I/O performance (文件I ...
- sysbench基准测试工具使用
1.源码编译安装 源码下载地址(目前有0.4/0.5/1.0三个分支版本):https://github.com/akopytov/sysbench 编译安装: unzip sysbench-1.0. ...
- 使用 sysbench对mysql进行压力测试介绍之一
sysbench是一款开源的多线程性能测试工具,可以执行CPU/内存/线程/IO/数据库等方面的性能测试.数据库目前支持MySQL/Oracle/PostgreSQL.本文只是简单演示一下几种测试的用 ...
随机推荐
- windows之死活格式化不了D/E/F盘
唉 见教程:Win10系统无法格式化电脑D盘的解决方法
- [剑指offer]数组中最小的K个数,C++实现
原创博文,转载请注明出处! http://github.com/wanglei5205 http://cnblogs.com/wanglei5205 # 题目 输入n个整数,找出其中最小的K个数.例如 ...
- erlang开发环境配置
第一步 从源码安装erlang git clone https://github.com/erlang/otp 目前最新版本为17.X cd otp/ ./configer 检查编译环境 sudo ...
- 日志组件logback的介绍及配置使用方法(一)
一.logback的介绍 Logback是由log4j创始人设计的又一个开源日志组件.logback当前分成三个模块:logback-core,logback- classic和logback-acc ...
- qt creator在Qt5中中文显示的问题
当我们用Qt Creater时,经常出会出现如下问题: 处理方法如下:用记事本打开你的源代码,然后点另存为,utf-8,编码覆盖,这时中文就没问题了但是会乱码.在字符串前加个宏QStringLiter ...
- 字符编码:ASCII,Unicode和UTF-8
字符编码是计算机技术的基石,想要熟练使用计算机,就必须懂得一点字符编码的知识. 1. ASCII码 我们知道,在计算机内部,所有的信息最终都表示为一个二进制的字符串.每一个二进制位(bit)有0和1两 ...
- win32鼠标和键盘相关函数
键盘相关函数:http://msdn.microsoft.com/en-us/library/windows/desktop/ms645530%28v=vs.85%29.aspx 鼠标相关函数:htt ...
- java之反射概述
类加载器和反射 类加载器: 1 类的加载过程: 当程序要使用某个类时,如果该类还未被加载到内存中,则系统会通过加载.连接.初始化三步骤来实现对这个类进行初始化. 加载:就是指将class文件读入内存 ...
- apache编译参数详解
常用编译参数: ./configure //配置源代码树–prefix=/usr/local/apache //体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录.–e ...
- [转]C#在WinForm下使用HttpWebRequest上传文件并显示进度
/// <summary> /// 将本地文件上传到指定的服务器(HttpWebRequest方法) /// </summary> /// <param name=&qu ...