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 ...
随机推荐
- 使用cmd查看Tensorboard的生成图
代码中"graph_practice7/"文件存放的是生成的神经网络图 现在要查看这个图,使用cmd 进入文件指定目录(我的文件存储地址是E:\workspace\PycharmP ...
- Asp.Net MVC中Controller、Action、View是如何激活调用的
上篇我们介绍了MVC的路由,知道在注册路由的时候会创建一个MvcHandler将其和Url规则一起放入到了RouteCollection中,之后请求通过UrlRoutingModule,根据当前的UR ...
- Stack in c#
public static void SaveStack() { string result = "Hello World"; Stack st = new Stack(); fo ...
- 学习React从接受JSX开始
详情参考官方JSX规范 虽然JSX是扩展到ECMAScript的类XML语法,但是它本身并没有定义任何语义.也就是说它本身不在ECMAScript标准范围之内.它也不会被引擎或者浏览器直接执行.通常会 ...
- jmeter 性能插件
mv jmeter-plugins-manager-0.16.jar /usr/local/Cellar/jmeter/3.1/libexec/lib/ext http://www.cnblogs.c ...
- 使用js生成条形码以及二维码
一.用js生成条形码这种业务场景不是很常见的,最近刚好又接到这种需求 Google一下,发现github还真有这方面的轮子,感谢github,省去了我们很多造轮子的过程, 好了言归正传,首先引入jsb ...
- Far Relative’s Problem (贪心 计算来的最多客人)
Description Famil Door wants to celebrate his birthday with his friends from Far Far Away. He has n ...
- 集训第五周动态规划 J题 括号匹配
Description We give the following inductive definition of a “regular brackets” sequence: the empty s ...
- I - DFS(依然是漫水填充)
Description There is a rectangular room, covered with square tiles. Each tile is colored either red ...
- java-得到字符串中出现次数最最多的字符,并打印出字符以及出现次数
最近面试总被面试到,整理出几种方式(有参考别人的部分) /** * java一个字符串中出现次数最多的字符以及次数 * @param args */ public static void main(S ...