MySQL mysqlslap pressure test
2016-09-12 17:49 by Pursuer.chen, 771 reading, 0 reviews, Favorites, compilation
Introduced
The Mysqlslap is a performance-measuring tool that comes with MySQL, and the mysqlslap is designed to be used as a test tool for testing your own data. Mysqlslap's report is relatively simple, mainly reflected in the implementation of the time, there is no sysbench like TPS, QPS and so on more detailed include.
Parameters
--AUTO-GENERATE-SQL-A automatically generate MySQL test statement--auto-generate-sql-add-autoincrement add auto_increment Word Number of segment--auto-generate-sql-execute-number=# queries--auto-generate-sql-guid-primary add GUID field--auto-generate- Sql-load-type=name mixed: Mixed, update: Update, write: Write, key: Read primary key, reading: query--auto-generate-sql-secondary-indexes=# set Cable Number of--auto-generate-sql-unique-query-number=# generate n different query SQL statements--auto-generate-sql-unique-write-number=# generate n different Write SQL statement--auto-generate-sql-write-number=# each thread write SQL statement number--commit=# set per how many SQL statements to mention Hand--compress-c Enable compression protocol--concurrency=#-C client Count (concurrency)--create=name Test the SQL statement or file--create-schema=name test data name--csv=name production CSV format number Write debug log (Windows not available) according to file--debug-#: mysqlslap-a-# "D:t:o,c:/debug.txt"--debug-check Post-Test print debugging information (winDows Not available)--debug-info-t information about print memory and CPU--default-auth=plugin authentication Plug-in--del The IMITER=STR-F statement delimiter is the default;--detach=# executes the n statement and disconnects the re-connection--enable-clear Text-plugin Enable clear Text authentication Plug-in--ENGINE=ENGINE_NAME-E test engine such as: Mysqlslap-e "MyISAM" or-E "myi Sam,innodb "--help Help information--host=host_name-h database Host--iterat ions=#-I repeats the number of times--login-path=name login configuration file--no-drop The schema--number-char-cols=#-X setting of the varchar type field is not removed after testing--number-int-cols=#-y Set int Type field number--number-of-queries=# each client runs the number of SQL statements--only-print Only show SQL statements that will be run--delimiter option affects--password=password-p database password--pipe Enable Pipeline--plUgin-dir=path plug-in directory--port=port_num-p database Port--post-query=value The SQL statement executed after the test--POST-SYSTEM=STR the system statement executed after the test--pre-query=value The SQL statement executed before the test--PRE-SYSTEM=STR the system statement executed before the test--protocol=type Link protocol TCP, socket, PIPE--QUERY=VALUE-Q test SQL statements such as: Mysqlslap--query= "SELECT * from T1"--se Cure-auth do not send password to server--silent-s do not display test (mute test)--socket=path -S connection Server Socket--ssl-ca=file_name--ssl-capath=dir_name--ssl-cert=file_na Me--ssl-cipher=cipher_list--ssl-crl=file_name--ssl-crlpath=dir_name--ssl-key=file_ Name--ssl-verify-server-cert--user=user_name-u Database user name--verbose-vOutput more information--version-v version information
Cases
1. Test 100, 200, 400 concurrent execution 10w SQL respectively.
mysqlslap-uroot-proot-h192.168.10.43-p3306--create-schema=chenmh--delimiter= ";"--query= "Call Pro_auto_select_ pri
Note: The time of the report output is mainly reflected in the time spent executing the query specified by--number-of-queries, which is 100 concurrent, 200 concurrent, and 400 concurrent 10w call execution time. By default,--iterations does not specify that a repeat operation is performed, if the time to repeat n this output is also the time spent in a single cycle.
2. Generate CSV
Mysqlslap-a-E "Myisam,innodb"--csv= "C:/a.csv"
Summary
Mysqlslap is mainly for database performance testing, and the automatic test function is limited, and the production report is not detailed enough, so it is recommended to use the Sysbench to do benchmark testing.
Pressure test tool MySQL Mysqlslap