sysbench对MySQL的压测
QPS - query per second
TPS - transaction per second 不是特别关注,每个业务场景中事务标准是不一样的
Ⅰ、sysbench测试框架
Ⅱ、常用测试脚本
[root@VM_42_63_centos lua]# pwd
/usr/local/src/sysbench-master/src/lua
[root@VM_42_63_centos lua]# ll *.lua
-rwxr-xr-x 1 root root 1446 Jun 27 02:35 bulk_insert.lua
-rw-r--r-- 1 root root 1307 Jun 27 02:35 empty-test.lua
-rw-r--r-- 1 root root 14468 Jun 27 02:35 oltp_common.lua
-rwxr-xr-x 1 root root 1290 Jun 27 02:35 oltp_delete.lua
-rwxr-xr-x 1 root root 2415 Jun 27 02:35 oltp_insert.lua
-rwxr-xr-x 1 root root 1265 Jun 27 02:35 oltp_point_select.lua
-rwxr-xr-x 1 root root 1649 Jun 27 02:35 oltp_read_only.lua
-rwxr-xr-x 1 root root 1824 Jun 27 02:35 oltp_read_write.lua
-rwxr-xr-x 1 root root 1118 Jun 27 02:35 oltp_update_index.lua
-rwxr-xr-x 1 root root 1127 Jun 27 02:35 oltp_update_non_index.lua
-rwxr-xr-x 1 root root 1440 Jun 27 02:35 oltp_write_only.lua
-rw-r--r-- 1 root root 1631 Jun 27 02:35 prime-test.lua
-rwxr-xr-x 1 root root 1933 Jun 27 02:35 select_random_points.lua
-rwxr-xr-x 1 root root 2132 Jun 27 02:35 select_random_ranges.lua
Ⅲ、开搞
这个老版本好像有参数设置热数据的量什么的,现在最新版本不知道咋搞,就先将就直接弄吧,不管了
准备数据
[root@VM_42_63_centos lua]# sysbench --mysql-host=127.0.0.1 --mysql-port=3307 --mysql-db=sbtest --tables=10 --table-size=10000 --mysql-user=root --mysql-password=123 oltp_update_index.lua prepare
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 10000 records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 10000 records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
...
开始测试
[root@VM_42_63_centos lua]# sysbench oltp_update_index.lua --mysql-host=127.0.0.1 --mysql-port=3307 --mysql-user=root --mysql-password=123 --threads=10 --time=120 --report-interval=10 run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
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!
[ 10s ] thds: 10 tps: 804.14 qps: 804.14 (r/w/o: 0.00/804.14/0.00) lat (ms,95%): 36.89 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 10 tps: 647.70 qps: 647.70 (r/w/o: 0.00/647.70/0.00) lat (ms,95%): 35.59 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 10 tps: 2220.50 qps: 2220.50 (r/w/o: 0.00/2220.50/0.00) lat (ms,95%): 18.28 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 10 tps: 4566.59 qps: 4566.59 (r/w/o: 0.00/4566.59/0.00) lat (ms,95%): 2.71 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 10 tps: 4194.30 qps: 4194.30 (r/w/o: 0.00/4194.30/0.00) lat (ms,95%): 7.30 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 10 tps: 4717.91 qps: 4717.91 (r/w/o: 0.00/4717.91/0.00) lat (ms,95%): 2.76 err/s: 0.00 reconn/s: 0.00
...
看结果,这里就不解释了,比较简单,随便看看就好
SQL statistics:
queries performed:
read: 0
write: 665574
other: 0
total: 665574
transactions: 665574 (5546.21 per sec.)
queries: 665574 (5546.21 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)
Throughput:
events/s (eps): 5546.2076
time elapsed: 120.0052s
total number of events: 665574
Latency (ms):
min: 0.27
avg: 1.80
max: 123.45
95th percentile: 2.43
sum: 1199263.13
Threads fairness:
events (avg/stddev): 66557.4000/209.28
execution time (avg/stddev): 119.9263/0.00
sysbench对MySQL的压测的更多相关文章
- sysbench对MySQL的压测,使用sysbench压测磁盘io
QPS - query per secondTPS - transaction per second 不是特别关注,每个业务场景中事务标准是不一样的 Ⅰ.sysbench测试框架 Ⅱ.常用测试脚本 [ ...
- sysbench 环境安装,压测mysql
源码路径:https://github.com/akopytov/sysbench 版本linux 6.8sysbench 0.5mysql 5.6.29 1.安装pip略 2.pip 安装bzr p ...
- MySQL mysqlslap压测
200 ? "200px" : this.width)!important;} --> 介绍 mysqlslap是mysql自带的一个性能压测工具:mysqlslap用于和其 ...
- mysql常用压测工具
关键字:mysql压测工具 mysqlslap.sysbench 基准测试sysbench 压力测试 tpcc 具体怎么使用百度
- 使用mysqlslap对mysql进行压测,观察Azure虚拟机cpu使用率
一直想做这个测试,原因很简单,很多人一直比较怀疑Azure的虚拟机性能,说相同的配置凭啥比阿里的虚拟机贵那么多,其实,我自己以前也怀疑过,但是接触Azure的几个月,确实发现Azure的虚拟机性能真的 ...
- 关于mysql性能压测之tpcc
软件下载: wget http://imysql.com/wp-content/uploads/2014/09/tpcc-mysql-src.tgz安装依赖:yum install -y mysql- ...
- 压力测试(四)-Mysql数据库压测实操
1.Jmeter压测实战之JDBC request压测Mysql讲解 简介:讲解jdbc压测mysql相关准备工作,jar包添加,配置讲解 1.Thread Group -> add -> ...
- 关于mysql的压测sysbench
测试表格:CREATE TABLE `sbtest` ( `id` int(10) unsigned NOT NULL auto_increment, `k` int(10) unsigned NOT ...
- MySQL Hardware--FIO压测
FIO参数 .txt 支持文件系统或者裸设备,-filename=/dev/sda2或-filename=/dev/sdb direct= 测试过程绕过机器自带的buffer,使测试结果更真实 rw= ...
随机推荐
- redis 数据结构及应用场景
1. String 常用命令: get.set.incr.decr.mget等 应用场景: String是最常用的数据类型,普通的key/value都可以归为此类,value其实不仅是String,也 ...
- php程序员招聘
岗位要求:-1年以上WEB端开发经验.-熟悉PHP语言的开发工作,熟练掌握LNMP开发,并具备良好的编程风格.-熟悉 http协议,掌握css js ajax 相关技术应用.-熟悉关系型数据,NOSQ ...
- [加密解密]CryptoAPI简介
CryptoAPI概述 Windows CryptoAPI是Microsoft 公司提出的安全加密应用服务框架,也是PKI推荐使用的加密 API.它提供了在Win32 环境下使用认证.编码.加密和签名 ...
- Python-Django-Ajax
什么是Ajax: 通过js语言跟后台进行交互的一个东西 -特点:异步,局部刷新 ajax往后台提交数据 $.ajax({ url:'请求的地址', type:'get/post', data:{key ...
- docker部署项目 <三>
使用docker运行一个控制台项目,新建一个控制台测试项目 一.安装mono,直接在网易镜像中心找下载路径 docker pull hub.c..com/library/mono:latest 二.安 ...
- VICA 架构设计
本文记录最近完成的一个通用实时通信客户端的架构. 背景 我们公司是做税务相关的软件,有针对大客户 MIS 系统,也有针对中小客户的 SaaS 平台.这些系统虽然都是 B/S 的,但是也需要使用 Act ...
- Angular路由——路由基础
一.路由相关对象 Router和RouterLink作用一样,都是导航.Router是在Controller中用的,RouterLink是在模版中用到. 二.路由对象的位置 1.Routes对象 配置 ...
- EF执行SQL返回动态类型
using System; using System.Data.Common; using System.Data.Entity.Core.Objects; using System.Data.Ent ...
- spark的bulkload报错及解决
需求 将HDFS上的数据解析出来,然后通过hfile方式批量写入Hbase(需要多列写入) 写入数据的关键api: rdd.saveAsNewAPIHadoopFile( stagingFolder, ...
- 第四次java实验
java实验 实验一: 要求 Android Stuidio的安装测试: 参考<Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)>第 ...