MySQL Benchmark benchmark test

Source: Internet
Author: User
Tags benchmark prepare

Git Project address:

Https://github.com/akopytov/sysbench

With Sysbench it's easy to do performance benchmarks for MySQL (which is, of course, a powerful tool, in addition to testing the main database performance, testing other aspects, details of their own crossing Web project documents)

Usage on Mac:

First, installation

Brew Install Sysbench

First, create a dedicated test database on MySQL, such as test

Iii. using Mr. Sysbench as test data

Sysbench--test=oltp--oltp-table-size=5000000--oltp-table-name=t_test--mysql-table-engine=innodb--mysql-host= localhost--mysql-db=test--mysql-user=root--mysql-password=*** prepare

The above heap means to create 5 million test data in the t_test of the test database of native localhost, and the database engine of the table is InnoDB.

tips: If you want to know what other parameters are available, you can enter a command

Sysbench--TEST=OLTP Help

Iv. running the test

Sysbench--test=oltp--oltp-table-size=5000000--oltp-table-name=t_test--mysql-table-engine=innodb--mysql-host= localhost--mysql-db=test--mysql-user=root--mysql-password=*** run

The last prepare is changed to run, and after the test, it will output something similar to the following:

Sysbench 0.4.12:multi-threaded System Evaluation Benchmarkno DB drivers specified, using mysqlrunning the test with Foll Owing Options:number of threads:1doing OLTP test. Running mixed OLTP testusing Special distribution (iterations, 1 pct of values is returned in the PCT cases) Using "BEG In "for starting transactionsusing auto_inc on the ID columnmaximum number of requests for OLTP test are limited to 10000Th Reads started!                           DONE.OLTP Test statistics:queries performed:read:140000 write: 50000 other:20000 total:210000 Transa    ctions:10000 (514.48 per sec.)    Deadlocks:0 (0.00 per Sec.)    Read/write requests:190000 (9775.14 per sec.) Other operations:20000 (1028.96 per sec.)    Test Execution Summary:total time:19.4371sTotal number of events:10000 all time taken by event execution:19.3581 Per-request statistics:                                 MIN:1.65MS avg:1.94ms Max:  13.48ms approx. Percentile:2.34msthreads fairness:events (Avg/stddev): 10000.0000/0.00 Execution Time ( Avg/stddev): 19.3581/0.00

Generally we are more concerned about:

    Transactions:                        10000  (514.48 per sec.)    Read/write requests:                 190000 (9775.14 per sec.)

This represents the number of transactions per second that can be processed and the read and write times per second.

Five, clean up the test data

Sysbench--test=oltp--oltp-table-size=5000000--oltp-table-name=t_test--mysql-table-engine=innodb--mysql-host= localhost--mysql-db=test--mysql-user=root--mysql-password=*** cleanup

The last one can be replaced by cleanup.

The Spring Festival Gala is too boring, not as good as writing two lines of code interesting, I wish you all the Park Friends Monkey, good health, everything!

MySQL Benchmark benchmark test

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.