Detailed performance comes mysqlslap --MySQL stress test tool (rpm)

 Reference herein blog address is: https://blog.csdn.net/fuzhongfaya/article/details/80943991  and  https://www.cnblogs.com/davygeek/p/5253830.html

The purpose of this paper is to organize their own hand, to prevent subsequent forget, on the one hand to verify the reference blog.

First, here to introduce common parameters and their descriptions:

--auto-generate-sql, -a table and automatic generation of test data, expressed mysqlslap own tool to generate SQL scripts to test the concurrent pressure.

--auto-generate-sql-load-type = type type test statement. To test environment is representative of a read or write operation, or a combination of both. The value can be: read, key, write, update and mixed (default).

--auto-generate-sql-guid-primary master key based on an increase of GUID

--auto-generate-sql-add- auto-increment representatives automatically add auto_increment columns of the table resulting from the 5.1.18 version began to support.
--number-char-cols = N, the number of character column -x N automatically generated test table contains default. 1
--number-int-cols = N, N -Y automatically generated test table contains much a numeric columns, the default. 1
--number queries-of-N = total number of queries test (× number of concurrent clients per customer queries)
--query = name, -q tests performed using custom script, for example, can be called custom sql statement or a stored procedure to execute the test.
--create-schema represents the self-test library name defined test schema, MySQL is the schema database.
After submitting a --commint = how many DML N.
--compress, -C if both the server and client support compression, compression of information transmission.
--concurrency = N, -c N represents concurrency, i.e. the number of clients simultaneously performing analog select. You can specify multiple values, or values comma --delimiter parameter specified as delimiter. For example: - concurrency = 100,200,500.
--engine = engine_name, -e engine_name representative of the engine to be tested, there can be multiple, separated by delimiters. For example: - engines = myisam, innodb.
--iterations = N, -i N the number of tests performed iteratively, representing different concurrent environment to be in, how many times each test run.
--only-print statements to print only a test without actually executed.
to disconnect and reconnect the --detach = N performs an N statement.
--debug-info, -T print information memory and CPU.

 

Perform the test:

1. The detailed process and perform a test printing test: mysqlslap -a -uroot -proot --only-print

 During the test, you can see first is to create a schema, then the table is created, the end of the test back to delete tables and delete schema

 

 

2. 50 and 100 respectively connected to the client 100 queries test

 mysqlslap -a -uroot -proot --concurrency=50,100 --number-of-queries=100

 Queries can be seen that the average number of connections assigned to each of the corresponding 1 and 2, respectively 

 

3. complex real test. 

Use --number-int-cols options to specify table contains four columns of type int. 
Use --number-char-cols options to specify table will contain 35 char type columns. 
Use --engine option to specify what kind of storage engine for testing. 

mysqlslap –uroot -proot --concurrency=50 --iterations=1 --number-int-cols=2--number-char-cols=1 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=mixed --engine=myisam,innodb --number-of-queries=200 --only-print

 

It can be seen sql statement generated default configuration tables have changed and, in addition to auto-increment numbers contains two outer columns and a column varchar

 

 4, to achieve performance testing based on custom sql statement

mysqlslap –uroot -proot --delimiter=";" --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" --query="SELECT * FROM a" --concurrency=50 --iterations=200

 

Guess you like

Origin www.cnblogs.com/cheng21553516/p/11374840.html