日期:2014-05-17  浏览次数:21026 次

网站性能测试工具ab(Apache Bench)
进入ab.exe根目录

ab -n 1000 -c 10 http://www.baidu.com/

ab -n 1000 -c 10 http://www.baidu.com/index.php





相关参数

-n:请求数

-c:并发数



可以测试的参数

Time taken for tests:测试用时

Requests per second: 每秒请求数

测试用时*每秒请求数=1000









[root@develop bin]# ab -n 1000 -c 20www.baidu.com/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $>apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd,http://www.zeustech.net/
Copyright 1997-2005 The Apache Software Foundation,http://www.apache.org/

Benchmarking www.baidu.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


ServerSoftware:       BWS/1.0
ServerHostname:       www.baidu.com
ServerPort:           80

DocumentPath:         /
DocumentLength:       3723 bytes

ConcurrencyLevel:     20

//测试用时

Time taken for tests:  121.445016 seconds
Completerequests:     1000
Failedrequests:       162
   (Connect: 0, Length: 150,Exceptions: 12)
Writeerrors:          0
Totaltransferred:     3422950 bytes
HTMLtransferred:      3164550 bytes

//每秒请求数
Requests persecond:    8.23[#/sec] (mean)
Time perrequest:      2428.900 [ms] (mean)

//每请求数耗时
Time perrequest:      121.445 [ms] (mean, across all concurrent requests)
Transferrate:         27.52 [Kbytes/sec] received

Connection Times (ms)
             min  mean[+/-sd]median   max
Connect:      13  8103549.2    20   45020
Processing:   11  366593.3   125   8362
Waiting:       0   37107.1    19    1999
Total:        27 11773528.2   325   45049

Percentage of the requests served within a certain time(ms)
50%    325
66%    568
75%    794
80%    971
  90%  3030
  95%  3068
  98%  9054
  99%  21047
100%  45049 (longestrequest)