apache-httpd2.2.17性能测试

在apache_home/bin目录下
常用的命令如下:
ab -n 1000 -c 250 http://127.0.0.1:80/
其中-n带表请求数,-c代表并发数
然后就可以看到一些相关性能的指标

输入命令:
./ab -n 100 -c 4 http://www.baidu.com/
输出结果:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.baidu.com (be patient).....done


Server Software:        BWS/1.0
Server Hostname:        www.baidu.com
Server Port:            80

Document Path:          /
Document Length:        7410 bytes

Concurrency Level:      4
Time taken for tests:   2.006 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      779200 bytes
HTML transferred:       741000 bytes
Requests per second:    49.85 [#/sec] (mean)
Time per request:       80.239 [ms] (mean)
Time per request:       20.060 [ms] (mean, across all concurrent requests)
Transfer rate:          379.34 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        3    7   3.0      7      19
Processing:    11   71 191.7     19    1420
Waiting:        4   10  19.9      7     204
Total:         15   78 192.0     26    1430

Percentage of the requests served within a certain time (ms)
  50%     26
  66%     30
  75%     32
  80%     34
  90%    228
  95%    435
  98%    846
  99%   1430
100%   1430 (longest request)


名字解释:
Server Software:表示被测试的Web服务器软件名称
Server Hostname:请求的URL中的主机部分名称
Server Port:被测试的WEB服务器的监听端口
Document Path:表示URL中的根据对路径
Document Length:http响应数据的正文长度
Concurrency Level:表示并发用户数(-c)
Time taken for tests:所有请求被处理完所花费的总时间
Complete requests:总请求数(-n)
Failed requests:失败请求数
Total transferred:所有请求的响应数据长度和,包括头和正文
HTML transferred:所有请求的响应数据中,正文数据的和
Requests per second:吞吐率
Time per request:用户平均请求等待时间 = time taken for tests / (complete requests / concurrency level)
Time per request:服务器平均请求处理时间 = 吞吐率的倒数 = time per request / concurrency level
Transfer rate:请求在单位时间内,从服务器获的数据长度
Percentage of the requests served within a certain time (ms):请求处理时间的分布情况

你可能感兴趣的:(apache,C++,c,C#)