MySQL压力测试工具的种类与实际应用

数据库 MySQL
我们今天主要讲述的是MySQL压力测试工具的种类,与MySQL压力测试工具的实际应用,以下就是具体内容的描述,望在你今后的学习中会对你有所帮助。

以下的文章主要介绍的是MySQL压力测试工具,我们大家都知道MySQL数据库在实际应用中可以说应用率还是不算低的,采用MySQL数据库也一般是中小企业,以下的文章就主要介绍的是MySQL数据库的压力测试工具。

MySQLslap

July 4th, 2009 Leave a comment Go to comments

 

MySQLslap是一个MySQL官方提供的压力测试工具。以下是比较重要的参数:

 

–defaults-file,配置文件存放位置

 

–concurrency,并发数

 

–engines,引擎

 

–iterations,迭代的实验次数

 

–socket,socket文件位置

 

自动测试:

–auto-generate-sql,自动产生测试SQL

 

–auto-generate-sql-load-type,测试SQL的类型。类型有mixed,update,write,key,read。

 

–number-of-queries,执行的SQL总数量

 

–number-int-cols,表内int列的数量

 

–number-char-cols,表内char列的数量

 

例如:

shell>MySQLslap –defaults-file=/u01/MySQL1/MySQL/my.cnf –concurrency=50,100 –iterations=1 –number-int-cols=4 –auto-generate-sql –auto-generate-sql-load-type=write –engine=myisam –number-of-queries=200 -S/tmp/MySQL1.sock

 

Benchmark

 

Running for engine myisam

 

Average number of seconds to run all queries: 0.016 seconds

 

Minimum number of seconds to run all queries: 0.016 seconds

 

Maximum number of seconds to run all queries: 0.016 seconds

 

Number of clients running queries: 50

 

Average number of queries per client: 4

 

Benchmark

Running for engine myisam

 

Average number of seconds to run all queries: 0.265 seconds

 

Minimum number of seconds to run all queries: 0.265 seconds

 

Maximum number of seconds to run all queries: 0.265 seconds

 

Number of clients running queries: 100

 

Average number of queries per client: 2

 

MySQL压力测试工具中指定数据库的测试:

–create-schema,指定数据库名称

 

–query,指定SQL语句,可以定位到某个包含SQL的文件

 

例如:

shell>MySQLslap –defaults-file=/u01/MySQL1/MySQL/my.cnf –concurrency=25,50 –iterations=1 –create-schema=test –query=/u01/test.sql -S/tmp/MySQL1.sock

 

Benchmark

 

Average number of seconds to run all queries: 0.018 seconds

 

Minimum number of seconds to run all queries: 0.018 seconds

 

Maximum number of seconds to run all queries: 0.018 seconds

 

Number of clients running queries: 25

 

Average number of queries per client: 1

 

Benchmark

Average number of seconds to run all queries: 0.011 seconds

 

Minimum number of seconds to run all queries: 0.011 seconds

 

Maximum number of seconds to run all queries: 0.011 seconds

 

Number of clients running queries: 50

 

Average number of queries per client: 1

 

以上的相关内容就是对MySQL压力测试工具的介绍,望你能有所收获。 

 

责任编辑:佚名 来源: 博客园
相关推荐

2010-06-07 17:46:46

Linux压力测试工具

2009-05-18 08:52:17

压力测试Rpplet测试

2014-08-11 16:39:25

2015-07-27 18:19:22

Linuxstress参数

2016-09-14 11:09:06

Web工具运维

2019-03-15 09:17:22

Web测试工具

2010-05-27 18:48:20

Linux压力测试工具

2012-06-25 14:30:48

Web

2012-02-02 09:12:16

JavaJMeter

2011-10-09 11:00:17

2012-02-08 14:16:55

Apache

2019-11-22 09:38:50

工具代码开发

2012-08-01 10:50:48

性能测试测试架构

2010-10-15 09:37:14

MySQL性能测试

2010-06-17 15:25:10

Linux测试工具

2009-08-11 09:52:37

软件测试测试工具

2010-05-18 14:21:35

MySQL视图

2009-06-26 10:22:58

JSF测试

2011-05-31 18:09:05

动态测试

2010-05-06 10:08:21

点赞
收藏

51CTO技术栈公众号