MySQL Study之--MySQL压力測试工具mysqlslap
www.2cto.com
[root@mysrv ~]# mysqlslap -V
mysqlslap Ver 1.0 Distrib 5.1.66, for redhat-linux-gnu (x86_64)
[root@mysrv ~]# mysqlslap --help
mysqlslap Ver 1.0 Distrib 5.1.66, for redhat-linux-gnu (x86_64)
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Run a query multiple times against the server.
Usage: mysqlslap [OPTIONS]
Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
The following groups are read: mysqlslap client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
--defaults-file=# Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
-? , --help Display this help and exit.
-a, --auto-generate-sql
Generate SQL where not supplied by file or command line.
--auto-generate-sql-add-autoincrement
Add an AUTO_INCREMENT column to auto-generated tables.
--auto-generate-sql-execute-number=#
Set this number to generate a set number of queries to
run.
--auto-generate-sql-guid-primary
Add GUID based primary keys to auto-generated tables.
--auto-generate-sql-load-type=name
Specify test load type: mixed, update, write, key, or
read; default is mixed.
--auto-generate-sql-secondary-indexes=#
Number of secondary indexes to add to auto-generated
tables.
--auto-generate-sql-unique-query-number=#
Number of unique queries to generate for automatic tests.
--auto-generate-sql-unique-write-number=#
Number of unique queries to generate for
auto-generate-sql-write-number.
--auto-generate-sql-write-number=#
Number of row inserts to perform for each thread (default
is 100).
--commit=# Commit records every X number of statements.
-C, --compress Use compression in server/client protocol.
-c, --concurrency=name
Number of clients to simulate for query to run.
--create=name File or string to use create tables.
--create-schema=name
Schema to run tests in.
--csv[=name] Generate CSV output to named file or to stdout if no file
is named.
-#, --debug[=#] This is a non-debug version. Catch this and exit.
--debug-check Check memory and open file usage at exit.
-T, --debug-info Print some debug info at exit.
-F, --delimiter=name
Delimiter to use in SQL statements supplied in file or
command line.
--detach=# Detach (close and reopen) connections after X number of
requests.
-e, --engine=name Storage engine to use for creating the table.
-h, --host=name Connect to host.
-i, --iterations=# Number of times to run the tests.
--no-drop Do not drop the schema after the test.
-x, --number-char-cols=name
Number of VARCHAR columns to create in table if
specifying --auto-generate-sql.
-y, --number-int-cols=name
Number of INT columns to create in table if specifying
--auto-generate-sql.
--number-of-queries=#
Limit each client to this number of queries (this is not
exact).
--only-print Do not connect to the databases, but instead print out
what would have been done.
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's asked from the tty.
-P, --port=# Port number to use for connection.
--post-query=name Query to run or file containing query to execute after
tests have completed.
--post-system=name system() string to execute after tests have completed.
--pre-query=name Query to run or file containing query to execute before
running tests.
--pre-system=name system() string to execute before running tests.
--protocol=name The protocol to use for connection (tcp, socket, pipe,
memory).
-q, --query=name Query to run or file containing query to run.
-s, --silent Run program in silent mode - no output.
-S, --socket=name The socket file to use for connection.
--ssl Enable SSL for connection (automatically enabled with
other flags).Disable with --skip-ssl.
--ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
--ssl).
--ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).
--ssl-cert=name X509 cert in PEM format (implies --ssl).
--ssl-cipher=name SSL cipher to use (implies --ssl).
--ssl-key=name X509 key in PEM format (implies --ssl).
--ssl-verify-server-cert
Verify server's "Common Name" in its cert against
hostname used when connecting. This option is disabled by
default.
-u, --user=name User for login if not current user.
-v, --verbose More verbose output; you can use this multiple times to
get even more verbose output.
-V, --version Output version information and exit.
[root@mysrv ~]# mysqlslap -uroot -poracle --concurrency=100 --iterations=1 --auto-generate-sql --auto-generate-sql-load-type=mixed --auto-generate-sql-add-autoincrement --engine=myisam --number-of-queries=10 --debug-info</span></strong>
測试信息:
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 0.473 seconds
Minimum number of seconds to run all queries: 0.473 seconds
Maximum number of seconds to run all queries: 0.473 seconds
Number of clients running queries: 100
Average number of queries per client: 0
User time 0.04, System time 0.14
Maximum resident set size 6732, Integral resident set size 0
Non-physical pagefaults 1333, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 2389, Involuntary context switches 48
备注:本次測试以100个并发线程、測试1次。自己主动生成SQL測试脚本、读、写、更新混合測试、自增长字段、測试引擎为myisam、共执行10次查询。输出cpu资源信息
-e innodb --debug-info
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 1.455 seconds
Minimum number of seconds to run all queries: 1.455 seconds
Maximum number of seconds to run all queries: 1.455 seconds
Number of clients running queries: 100
Average number of queries per client: 0
User time 0.03, System time 0.12
Maximum resident set size 5420, Integral resident set size 0
Non-physical pagefaults 1273, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 536, Involuntary context switches 151
--engine=myisam,innodb --number-of-queries=200 --verbose --socket=/tmp/mysql.sock -uroot -poracle
Running for engine myisam
Average number of seconds to run all queries: 1.521 seconds
Minimum number of seconds to run all queries: 1.397 seconds
Maximum number of seconds to run all queries: 2.092 seconds
Number of clients running queries: 50
Average number of queries per client: 4
Running for engine myisam
Average number of seconds to run all queries: 1.465 seconds
Minimum number of seconds to run all queries: 1.279 seconds
Maximum number of seconds to run all queries: 1.996 seconds
Number of clients running queries: 100
Average number of queries per client: 2
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 1.367 seconds
Minimum number of seconds to run all queries: 1.260 seconds
Maximum number of seconds to run all queries: 1.576 seconds
Number of clients running queries: 200
Average number of queries per client: 1
Running for engine innodb
Average number of seconds to run all queries: 1.198 seconds
Minimum number of seconds to run all queries: 1.084 seconds
Maximum number of seconds to run all queries: 1.301 seconds
Number of clients running queries: 50
Average number of queries per client: 4
Running for engine innodb
Average number of seconds to run all queries: 1.423 seconds
Minimum number of seconds to run all queries: 1.238 seconds
Maximum number of seconds to run all queries: 1.761 seconds
Number of clients running queries: 100
Average number of queries per client: 2
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 1.389 seconds
Minimum number of seconds to run all queries: 1.268 seconds
Maximum number of seconds to run all queries: 1.653 seconds
Number of clients running queries: 200
Average number of queries per client: 1
备注:
MySQL Study之--MySQL压力測试工具mysqlslap的更多相关文章
- php性能优化(一)压力測试工具篇
ab使用 Apache附带的压力測试工具ab,很easy使用,而且全然能够摸你各种条件对Webserver发起測试请求.ab能够直接在Webserver本地发起測试请求.这对于须要了解server的处 ...
- ubuntu 14.04 LTS 安装webbentch压力測试工具
近期在做 压力測试工具,除了apache的ab測试工具外,发现webbentch工具也不错,这里简介下这两个工具. 一.webbentch安装: wget http://blog.s135.com/s ...
- webbench压力測试工具
apache的測试工具ab 在并发100个以上后会出现错误.网上也有非常多改ab源代码来解禁的. 只是还是推荐一款比較好用的压力測试工具webbench wget http://blog.zyan.c ...
- CentOS6.5 64位站点压力測试工具webbench
在Apache中有自带的ab命令能够測试服务的压力,而nginx没有自带的命令,必需要採用第三方软件来測试.今天就简介一下webbench对nginx的压力測试,压力測试是对系统管理员和运维人员必须的 ...
- 学习使用Jmeter做压力測试(一)--压力測试基本概念
一.性能測试的概念 性能測试是通过自己主动化的測试工具模拟多种正常峰值及异常负载条件来对系统的各项性能指标进行測试.负载測试和压力測试都属于性能測试,两者能够结合进行. 通过负载測试, ...
- Android开发之按键、触摸屏和手势输入专业压力測试方法
按键输入.触摸屏输入和手势笔画输入等功能是Android开发的基本功能.其稳定性和健壮性对移动应用系统开发很重要.按键.触摸屏和手势输入专业压力測试方法能够使用Monkey,相应用程序进行压力測试,检 ...
- MySQL Study之--MySQL下图形工具的使用(MySQL Administrator)
MySQL Study之--MySQL下图形工具的使用(MySQL Administrator) 系统环境: 操作系统: Windows 7(64) 下载地址:http://www.soft ...
- 移动測试技术保护源码!解码全球首款移动端白盒測试工具ThreadingTest (文章转自己主动点科技)
作者 智晓锋 - 2014/07/14 自从斯诺登曝光美监听丑闻事件之后,我国政府就将信息安全问题上升到了国家安全的高度.基于此.国内的一家创业公司推出了智能型Android真机白盒測试以及开发辅助类 ...
- 站点系统压力測试Jmeter+Badboy
近期项目须要压力測试,因此搜了几款试用,首选的是LoadRunner这款大名鼎鼎的測试软件: LoadRunner11 下载请猛戳这里 传送门LoadRunner破解文件 下载请猛戳这里 传送门Loa ...
随机推荐
- Webpack 入门(一):安装 / 打包 / 命令行
一:安装webpack和基本环境搭建 新建一个工作的文件夹(我取的名字叫Webpack) 打开命令行,cd进入该文件夹 //初始化一下npm > E:\work\Webpack>npm i ...
- ssd遇到的bug
从训练一开始就loss为0: 最开始以为是在生成train.lmdb前没有对label_map进行修改,发现并不是这个问题 1.训练的命令是:python ./examples/ssd/ssd_pas ...
- 扫黑除恶Team第四次团队作业
二.博客撰写要求 文章开头给出团队序号,开发的软件名称,仓库地址. 给出完成本次冲刺需要做的事情(Sprint Backlog)及相应说明. 本次冲刺总结. 三.评分规则 注意:本次作业总分61分.发 ...
- c++ 回调的实现
什么是回调?通常发生在需要两个角色即调用者与实现者的情形上,即我们希望当产生某个事件时,调用实现者定义的某个函数.当然这个概念很大,不是说操作系统的信号量,条件变量什么的,是在语言级别实现,如一个Fr ...
- BZOJ 3876 支线剧情 有源汇有上下界最小费用可行流
题意: 给定一张拓扑图,每条边有边权,每次只能从第一个点出发沿着拓扑图走一条路径,求遍历所有边所需要的最小边权和 分析: 这道题乍一看,可能会想到什么最小链覆盖之类的,但是仔细一想,会发现不行,一是因 ...
- CSS 全局样式
设置全局 CSS 样式:基本的 HTML 元素均可以通过 class 设置样式并得到增强效果:还有先进的栅格系统.
- wepy.request 请求成功但是不进入success和fail方法,及请求传参问题
1.根据wepy官方给的文档如下,用then拿后台返回的数据,如果用then报错,请先在app.wpy中配置promise. 没有success,fail,complete方法,如若用了也是不会进入方 ...
- pycharm中提交Git 忽略部分代码
痛点: 项目中,有些配置项,或者比较隐私的东东,不想上传 解决:在项目根路径下,创建.gitignore 文件 文件中可以写文件名.文件路径等 结果: 提交到git,发现果真没有dbconne ...
- Python之面向对象slots与迭代器协议
Python之面向对象slots与迭代器协议 slots: # class People: # x=1 # def __init__(self,name): # self.name=name # de ...
- YOLOv3测试命令
一.老规矩 在darknet\build\darknet\x6下按住shift键,点击鼠标右键选择“在此处打开Powershell 窗口(s)” 二.测试图片命令: .\darknet detect ...