????1. ab???????
????ab??????apache bench??
??????????????????£?
????ab??Apache?????????Э??(HTTP)?????????????????????????浱????????Apache???????????????????????Apache?????????????????
????ab?????apache??????????????????????????????????apache??????????????????????????????????web server????????????????nginx??tomcat??IIS????
????linux???°????apache httpd??????????????ab????????????????????????????????????? http://httpd.apache.org/ ??
????windows????????ab??????????????????????????Windows?汾???ɡ?
????2. ?Щ???????
???????????????ab??????????????Щ????????????????
???????????Requests per second??
????????????????????????????????????????λ??reqs/s????????????????????μ?λ??????????????????????????????μ?λ?????????????????????????????????
??????????????????? / ?????????Щ??????????????????
????Request per second = Complete requests / Time taken for tests
????????????????The number of concurrent connections??
???????????????????????????????????????????????????
???????????????The number of concurrent users??Concurrency Level??
????????????????????????????????????????????????????????????????????????????
???????????????????Time per request??
??????????????????????????????????????/ ?????????? / ???????????????
????Time per request = Time taken for tests /?? Complete requests / Concurrency Level??
??????????????????????Time per request: across all concurrent requests??
?????????????????????????????????????? / ????????????
????Time taken for / testsComplete requests
???????????????????????????????????????????????????????/?????????????
????Time per request / Concurrency Level
????3. ??????
????????????
????ab -n 800 -c 100  http://192.168.14.8/    # ???800??????100·????
????ab -t 60 -c 100 http://192.168.14.8/      # ???????60??100·????
?????????????У?
????-n requests     ???????е???????
????-c concurrency  ????·????????
????-t timelimit    Seconds to max. wait for responses
????-b windowsize   tcp????/???????????С???????λ???????
????-p postfile     postfile???????post????????????????? -T ????
????-u putfile      putfile???????put????????????????? -T ????
????-T content-type http?????content-type????????? 'application/x-www-form-urlencoded'??????? 'text/plain'
????-X proxy:port   ???÷???????????
????-g filename     ??????????filename?У??????????gnuplot???
?????????????????????????ο??? http://httpd.apache.org/docs/2.2/programs/ab.html ??
????4. ??????
???????100·?????????????15000?Σ??????ab????????????????????apache httpd??
????ab -n 15000 -c 100  http://192.168.14.202/index.html
???????н????????????????
????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 192.168.14.202 (be patient)
????Completed 1500 requests
????Completed 3000 requests
????Completed 4500 requests
????Completed 6000 requests
????Completed 7500 requests
????Completed 9000 requests
????Completed 10500 requests
????Completed 12000 requests
????Completed 13500 requests
????Completed 15000 requests
????Finished 15000 requests
????Server Software:        Apache/2.2.15
????Server Hostname:        192.168.14.202
????Server Port:            80
????Document Path:          /index.html
????Document Length:        16 bytes
????Concurrency Level:      100
????Time taken for tests:   4.610 seconds
????Complete requests:      15000
????Failed requests:        0
????Write errors:           0
????Total transferred:      3126656 bytes
????HTML transferred:       240512 bytes
????Requests per second:    3253.54 [#/sec] (mean)
????Time per request:       30.736 [ms] (mean)
????Time per request:       0.307 [ms] (mean?? across all concurrent requests)
????Transfer rate:          662.29 [Kbytes/sec] received
????Connection Times (ms)
????min  mean[+/-sd] median   max
????Connect:        2    6   2.4      6      18
????Processing:     9   24   2.9     24      31
????Waiting:        6   22   3.3     22      30
????Total:         19   31   2.6     31      39
????Percentage of the requests served within a certain time (ms)
????50%     31
????66%     32
????75%     32
????80%     33
????90%     34
????95%     35
????98%     36
????99%     37
????     39 (longest request)