ab 安装部署

yum -y install httpd-tools

 

 -c 用户数  -n 请求数

ab -c 1000 -n 10000 http://192.168.2.38/  
# -c指定1000并发,-n指定总10000次,相当于1000个人访问10次。
# -k 是否开启长连接
Server Software:        nginx/1.8.1  #服务器信息和版本
Server Hostname:        192.168.2.38 #服务器的域名
Server Port:            80 #端口
Document Path:          / #访问的路径
Document Length:        612 bytes #文档的大小为 612 bytes(此为http响应的正文长度)
Concurrency Level:      1000 #并发请求数
Time taken for tests:   0.287 seconds #整个测试持续的时间,默认秒
Complete requests:      1000 #完成的请求数
Failed requests:        0 #失败的请求书
Write errors:           0 #网络连接写入错误数
Total transferred:      844000 bytes #传输的总数据量
HTML transferred:       612000 bytes #传输的HTML内容传输量
Requests per second:    3485.11 [#/sec] (mean) #平均每秒请求数
Time per request:       286.935 [ms] (mean) #所有用户都请求一次的平均时间
Time per request:       0.287 [ms] (mean, across all concurrent requests) #单个用户请求一次的时间
Transfer rate:          2872.49 [Kbytes/sec] received #传输速率
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   84   4.1     84      94
Processing:    86   99   6.6    100     109
Waiting:        0   83  16.2     84     108
Total:         95  183   7.4    182     195

#所有服务请求的百分比占用时间,这里50%的请求用时182ms,一般看90%的部分
Percentage of the requests served within a certain time (ms)
  50%    182
  66%    188
  75%    191
  80%    192
  90%    193
  95%    194
  98%    194
  99%    194
 100%    195 (longest request)

 

posted on 2023-03-27 16:49  属于我的梦,明明还在  阅读(291)  评论(0)    收藏  举报