ssslinppp

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

[[TOC]]


Http性能测试工具

ab(ApacheBench)

  • 安装:
yum install httpd
  • 使用
ab -n 20 -c 1 192.168.35.1:8988/fortest

参数说明:

-n: 总请求次数;
-c: 并发请求数(默认为1)
  • 结果示例:
[root@localhost ~]# ab -n 20 -c 1 192.168.35.1:8988/fortest
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.35.1 (be patient).....done


Server Software:        
Server Hostname:        192.168.35.1
Server Port:            8988

Document Path:          /fortest
Document Length:        2 bytes

Concurrency Level:      1
Time taken for tests:   2.099 seconds  //总共耗费时间
Complete requests:      20
Failed requests:        0
Write errors:           0
Total transferred:      2420 bytes
HTML transferred:       40 bytes
Requests per second:    9.53 [#/sec] (mean)   //每秒处理请求数量
Time per request:       104.968 [ms] (mean)   //每次并发消耗平均时间
Time per request:       104.968 [ms] (mean, across all concurrent requests) //每次请求消耗平时时间
Transfer rate:          1.13 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.9      0       9
Processing:   101  104   3.3    103     114
Waiting:      101  103   3.4    102     114
Total:        102  105   3.8    103     114

Percentage of the requests served within a certain time (ms)
  50%    103
  66%    104
  75%    107
  80%    108
  90%    112
  95%    114
  98%    114
  99%    114
 100%    114 (longest request)

posted on 2018-01-08 16:06  ssslinppp  阅读(332)  评论(0编辑  收藏  举报