mysqlslap stress test mysql

Brief introduction

mysqlslap mysql is the official stress test tool
without having to install, mysql comes

The official reference documentation: https://dev.mysql.com/doc/refman/5.7/en/mysqlslap.html#option_mysqlslap_debug-info

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

test

Example 1

Query 300, the number of concurrent 50
mysqlslap -concurrency = -a 50-of-Queries --number 300 -hlocalhost -uroot--proot

Benchmark
    Average number of seconds to run all queries: 19.286 seconds
    Minimum number of seconds to run all queries: 19.286 seconds
    Maximum number of seconds to run all queries: 19.286 seconds
    Number of clients running queries: 1
    Average number of queries per client: 300

Benchmark
    Average number of seconds to run all queries: 16.868 seconds
    Minimum number of seconds to run all queries: 16.868 seconds
    Maximum number of seconds to run all queries: 16.868 seconds
    Number of clients running queries: 2
    Average number of queries per client: 150

Benchmark
    Average number of seconds to run all queries: 13.614 seconds
    Minimum number of seconds to run all queries: 13.614 seconds
    Maximum number of seconds to run all queries: 13.614 seconds
    Number of clients running queries: 3
    Average number of queries per client: 100

Guess you like

Origin blog.51cto.com/13990437/2401007