mysqlslap压力测试mysql

简介

mysqlslap是mysql官方的压力测试工具 无需另外安装,mysql自带

官方参考文档:https://dev.mysql.com/doc/ref…

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.

测试

示例1

查询300次,并发数50
mysqlslap -a -concurrency=50 –number-of-queries 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
    原文作者:小小的太阳
    原文地址: https://segmentfault.com/a/1190000019459181
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞