Mysqlslap is a benchmark testing tool that comes with benchmark after MySQL5.1. This tool can simulate multiple clients simultaneously and concurrently send query updates to the server. It provides performance testing data and provides the performance of multiple engines.
Mysqlslap is a benchmark testing tool that comes with benchmark after MySQL5.1. This tool can simulate multiple clients simultaneously and concurrently send query updates to the server. It provides performance testing data and provides the performance of multiple engines.
,
Use a custom script for testing. a vm can be executed by a stored procedure or SQL statement;
-- Only-print: only the SQL statements involved in the test are printed and not actually executed;
Example:
Test 200 concurrent write performance. Test 20 times. The Hong Kong virtual host automatically generates an SQL script. The test table contains 35 int fields, Hong Kong virtual host, and 20 char fields, the test engine is innodb and myisam respectively. 3000 queries are executed each time;
. /Bin/mysqlslap -- socket =/usr/local/mysql. sock -- port = 3306 -- concurrency = 200 -- iterations = 20 -- auto-generate-SQL-load-type = write -- auto-generate-SQL-add- autoincrement -- number-int-cols = 35 -- number-char-cols = 20 -- engine = innodb, myisam -- create-schema = sysbench -- number-of-queries = 3000 -- debug-info
Result:
BenchmarkRunning for engine innodbAverage number of seconds to run all queries: 6.385 secondsMinimum number of seconds to run all queries: 3.021 secondsMaximum number of seconds to run all queries: 12.969 secondsNumber of clients running queries: 200 Average number of queries per client: 15 BenchmarkRunning for engine myisamAverage number of seconds to run all queries: 0.621 secondsMinimum number of seconds to run all queries: 0.442 secondsMaximum number of seconds to run all queries: 1.134 secondsNumber of clients running queries: 200 Average number of queries per client: 15 User time 0.66, System time 1.97 Maximum resident set size 10060, integral resident set size 0Non-physical pagefaults 50486, Physical pagefaults 5, Swaps 0 Blocks in 584 out 96, Messages in 0 out 0, Signals 0 Voluntary context switches 298373, Involuntary context switches 1469
Custom SQL test script:
Mysqlslap -- create =/yourpath/test. SQL -- query =/yourpath/test1. SQL -- concurrency = 50,100,200 -- iterations = 20 -- engine = myisam, innodb
This article is from the "Technology Achievement dream" blog. Please keep this source