MySQL benchmarking tool-mysqlslap

Source: Internet
Author: User
Tags time 0
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

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.