Mysql performance optimization -12.mysqlslap stress testing tool

Server testing tools
directly in the CMD to run:
basic syntax is: mysqlslap options
typical test options are as follows:

C:\Users\Jay>mysqlslap --help
mysqlslap  Ver 1.0 Distrib 5.7.21, for Win64 (x86_64)
Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Run a query multiple times against the server.

Usage: mysqlslap [OPTIONS]

1. Test generating SQL

C:\Users\Jay>mysqlslap --auto-generate-sql -u root -p
Enter password: **********
Benchmark
        Average number of seconds to run all queries: 0.016 seconds
        Minimum number of seconds to run all queries: 0.016 seconds
        Maximum number of seconds to run all queries: 0.016 seconds
        Number of clients running queries: 1
        Average number of queries per client: 0

2. concurrent test

C:\Users\Jay>mysqlslap --auto-generate-sql --concurrency=100 -u root -p
Enter password: **********
Benchmark
        Average number of seconds to run all queries: 0.265 seconds
        Minimum number of seconds to run all queries: 0.265 seconds
        Maximum number of seconds to run all queries: 0.265 seconds
        Number of clients running queries: 100
        Average number of queries per client: 0

3. several rounds of testing

C:\Users\Jay>mysqlslap --auto-generate-sql --concurrency=400 --iterations=10 -u root -p
Enter password: **********
Benchmark
        Average number of seconds to run all queries: 2.793 seconds
        Minimum number of seconds to run all queries: 2.375 seconds
        Maximum number of seconds to run all queries: 3.438 seconds
        Number of clients running queries: 400
        Average number of queries per client: 0

4. Storage Engine Test

C:\Users\Jay>mysqlslap --auto-generate-sql --concurrency=400 --iterations=3 --engine=myisam -u root -p
Enter password: **********
Benchmark
        Running for engine myisam
        Average number of seconds to run all queries: 2.135 seconds
        Minimum number of seconds to run all queries: 2.094 seconds
        Maximum number of seconds to run all queries: 2.172 seconds
        Number of clients running queries: 400
        Average number of queries per client: 0

C:\Users\Jay>mysqlslap --auto-generate-sql --concurrency=400 --iterations=3 --engine=innodb -u root -p
Enter password: **********
Benchmark
        Running for engine innodb
        Average number of seconds to run all queries: 3.120 seconds
        Minimum number of seconds to run all queries: 2.328 seconds
        Maximum number of seconds to run all queries: 3.610 seconds
        Number of clients running queries: 400
        Average number of queries per client: 0

Guess you like

Origin blog.csdn.net/weixin_34037515/article/details/90888504