[Original] MySQL official stress testing tool mysqlslap

Source: Internet
Author: User

[Original] MySQL official stress testing tool mysqlslap

Introduction to mysqlslap

Mysqlslap is a diagnostic program designed to emulate client load for a MySQL server and to report the timing of each stage. it works as if multiple clients are accessing the server. mysqlslap is available as of MySQL 5.1.4.

Ii. Use of mysqlslap

  1. Create schema, table, and optionally any stored programs or data you want to using for the test. This stage uses a single client connection.
  2. Run the load test. This stage can use your client connections.
  3. Clean up (disconnect, drop table if specified). This stage uses a single client connection.

Example of mysqlslap Tool

As shown in:

 

Iv. Introduction to common mysqlslap Parameters

-Auto-generate-SQL,-
// Automatically generate test tables and data
-Auto-generate-SQL-load-type = Type
// Type of the test statement. Optional values: read, key, write, update, and mixed (default ).
-Number-Char-cols = N,-x n
// The number of character columns in the automatically generated test table. The default value is 1.
-Number-int-cols = N,-y n
// The number of numeric columns in the automatically generated test table. The default value is 1.
-Number-of-queries = N
// Total Number of test queries (number of concurrent customers × number of queries per customer)
-Query = Name,-Q
// Use a custom script to perform the test. For example, you can call a custom stored procedure or SQL statement to perform the test.
-Create-schema
// Test the schema. The schema in MySQL is also the database
-Commint = N
// How many DML records are submitted once?
-Compress,-C
// If both the server and client support compression, the compressed information is transmitted.
-Concurrency = N,-C n
// Concurrency, that is, the number of clients that are simulated to execute the SELECT statement at the same time. Multiple values can be specified. Use a comma or the value specified by the-delimiter parameter as the delimiter.
-Engine = engine_name,-e engine_name
// The storage engine used to create a test table. You can specify multiple storage engines.
-Iterations = N,-I n
// Test execution iterations
-Detach = N
// Disconnect and reconnect after N statements are executed
-Debug-Info,-T
// Print memory and CPU Information
-Only-print
// Print only test statements without actual execution

For more details, please visit the MySQL Official Website: http://dev.mysql.com/doc/refman/5.1/en/mysqlslap.html

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.