ab压测工具

cooolr 于 2021-10-18 发布

安装

ubuntu: sudo apt install apache2-utils

centos: yum -y install httpd-tools

使用

-n 执行的请求数量
-c 并发请求个数
ab -n 10000 -c 100 http://127.0.0.1:8005/
# 平均每秒的请求数
Requests per second:    1182.26 [#/sec]**d** (mean)
# 平均每个请求消耗的时间
Time per request:       84.584 [ms] (mean)

POST示例

ab -T 'application/json' -p data.json -n 1 -c 1 http://127.0.0.1:18032/multi_type_rank_v2