ab 压力测试接口性能

测试post 请求的接口
1,cmd至ab.exe 所在目录

2,在ab目录下新建post.txt文本文件,输入要post提交的数据如:
phone=13566668888&password=123456789

3,命令行输入:
[post]压测 ab -t 30 -c 10 -p post.txt -T application/x-www-form-urlencoded http://192.168.0.147/login

[get]压测 ab -c 10 -n 100 http://192.168.0.147/about.html

参数: -c 表示多少个客户端同时请求,即并发量
-t 表示总共请求多长时间
-n 表示总共发起多少请求

4,查看结果
Concurrency Level : 并发级别
Time taken for tests : 总耗时
Complete requests : 总请求量
Request per second : 每秒处理请求数(TPS)
Time per Request :处理每个请求耗时 服务器收到请求,响应页面要花费的时间

猜你喜欢

转载自blog.csdn.net/qq_39647045/article/details/82692664