说明
类似于linux 的 curl 请求
ab -h
查看帮助说明
-c 并发数
-n 请求次数
-H header
-p body
将body中 json 串写到 a.json 中-T POST数据所使用的Content-type头信息
举例
1. ab -n 100 -c 10 https://www.baidu.com
2. ab -n 1 -c 1 -p f:/a.txt -T application/x-www-form-urlencoded https://www.baidu.com
3. ab -n 1 -c 1 -p f:/a.txt -T application/x-www-form-urlencoded -H "client:xxx" -H "token:xxx" https://www.baidu.com
ab输出项信息的解释
Server Software: web服务器软件及版本
Server Hostname: 表示请求的URL中的主机部分名称
Server Port: 被测试的Web服务器的监听端口
Document Path: 请求的页面路径
Document Length: 页面大小
Concurrency Level: 并发数
Time taken for tests: 测试总共花费的时间
Complete requ