MySQL pressure test tool-mydbtest

Source: Internet
Author: User

MySQL pressure test tool-mydbtest

Preface
This article introduces mydbtest (mydbtest_linux64.bin, compiled by Lou Fang Xin Da Niu), a tool for database stress testing without installation ). this stress testing software is different from common stress testing tools such as sysbench and tpcc. It is free of installation and easy to use, and can be customized for business SQL.

Download from the help house resource station:

------------------------------------------ Split line ------------------------------------------

Free in http://linux.bkjia.com/

The username and password are both www.bkjia.com

The specific download directory is/July 6, 2016,/July 22, April,/mydbtest/of the MySQL stress testing tool/

For the download method, see

------------------------------------------ Split line ------------------------------------------

Ii. How to Use
2.1 random data generator
In the configuration file, we specify the random data type. The value range is a int 10 30000. An integer ranging from 10 to is randomly generated. Note that a must be the value used in the where condition, for example, where id =: a:, syntax

  1. Varname VARTYPE minimum maximum

This tool supports 7 types

  1. Sequence
  2. Int: I _value int min max
  3. Char: c_value char min_length max_length
  4. Float: f_value float min max
  5. Double: d_value double min max
  6. Date: create_time date-10 10 will generate a random time before and after ten days, format:
  7. Timestamp: Same as date, in the format of YYYY-MM-DD HH24: MI: SS

The software supports multiple field types in the same configuration file.
2.2 configuration file
The configuration file format is as follows:
Option
Name yangyi_20160331
User username/password @ hostname: port: database
Loop N cycles
You can use % p to specify a log file for each pressure test process.
How long does wait N wait after each loop is executed (not the interval between each SQL statement execution. The default value is 0.
Show N how many seconds each time display the pressure test response time 60 s by default
Tran [yes] transaction type. If this parameter is set to yes, the SQL statements in tran in will be executed in the same transaction.
The number of times the commit [N] loop executes the commit command. If a large amount of test data is configured, we recommend that you set this value to a larger value. Note that the commit parameter only works when tran is set to yes.
Time Specify how duration to be executed for the SQL statements, default value is
3600 seconds, you can specify "d1" for one day, "h1" for on hour, "m1" for one minute, and "s60" for 60 seconds.
Declare
# Random Number
Varname1 int 10 100000
Varname2 char 1 30
[......]
Begin
# You can configure select, insert, update, and delete statements, or use database statements included in {}. Each statement must be separated by a semicolon.
Insert into <table name> (...) VALUES (: varname1,: varname2 ,...);
SELECT * FROM <table name> WHERE... >: Varname1;
{Begin
Update t_kc_center set col2 = col2-1 where col1 =: id;
Update t_kc_center set col2 = col2 + 1 where col1 =: id + 1;
End;
}
End

A specific example:
Test. cnf
# This configuration file connects to the database and executes 2000 queries.
Option
Name mysql_test
Loop 2000
User yang/yang@127.0.0.1: 3308: test
Declare
A int 10 30000
Begin
Select * from t_mytest where col1 =:;
End
3. Specific Use
Root @ rac3 :~ #>./Mydbtest_linux64.bin -- help
MYDBTEST: MySQL Database Test Utility, Release 1.0.1
(@) Copyright Lou Fangxin (AnySQL.net) 2012-2013, all rights reserved.
Usage: mysqldbtest keyword = value [keyword = value [...]
Valid Keywords:
User = username/password @ tnsname for source and target.
Query = test case file.
Degree = parallel degree for multiple threads test
Root @ rac3 :~ #>./Mydbtest_linux64.bin query = test. cnf degree = 1
MYDBTEST: MySQL Database Test Utility, Release 1.0.1
(@) Copyright Lou Fangxin (AnySQL.net) 2012-2013, all rights reserved.
14:08:27 ================== mysql_test ============== ==============
14:08:27 SQL01 exe = 2000 fail = 0 row = 1105 ela = 231 MS avg = 115 us
14:08:27 SQL01 1 MS exec = 1996, ela = 225 MS, avg = 113 us, pct = 99, 99
14:08:27 SQL01 2 MS exec = 3, ela = 3 MS, avg = 1031 us, pct = 0, 99
14:08:27 SQL01 3 MS exec = 1, ela = 2 MS, avg = 2481 us, pct = 0,100
14:08:27 Total tran = 2000 = 8333/s, qtps = 2000 = 8333/s, ela = 233 MS, avg = 116 us
Summary: SQL01 exec = 2000, rows = 1105 = 55/e, avg = 115 us
Summary: exec = 2000/s, qtps = 2000/s

During stress testing, if you find that such a report does not meet the requirements, you can use orzdba to view the database's qps tps and select the data to draw a chart.

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.