ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab
./ab -n1000 -c100 http://www.xxx.com/a.html
##首先是apache的版本信息
This is ApacheBench, Version 2.3 <<spanclass="MathJax_Preview">
Revision:655654
>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,http://www.zeustech.net/
Licensed to The Apache Software Foundation,http://www.apache.org/
Benchmarking vm1.jianfeng.com (be patient)
ServerSoftware:
ServerHostname:
ServerPort:
DocumentPath:
DocumentLength:
ConcurrencyLevel:
Time taken for tests:
Completerequests:
Failedrequests:
Writeerrors:
Totaltransferred:
HTMLtransferred:
Requests persecond:
Time perrequest:
Time perrequest:
Transferrate:
Connection Times (ms)
Connect:
Processing:
Waiting:
Total:
Percentage of the requests served within a certain time(ms)
100%
2 ab也可以运行在windows中,如果在windows下安装apache,就可以在bin下找到ab.exe
直接就可以使用,不用依赖其他的dll
下面是我使用ab.exe 测试新浪一个页面的结果:
C:\Users\nickyjf\Desktop\useful>ab -n1000 -c100http://sports.sina.com.cn/k/2011-05-24/12095590365.shtml
This is ApacheBench, Version 2.3 <<spanclass="MathJax_Preview">
>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,http://www.zeustech.net/
Licensed to The Apache Software Foundation,http://www.apache.org/
Benchmarking sports.sina.com.cn (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
Completed 1000 requests
Finished 1000 requests
ServerSoftware:
ServerHostname:
ServerPort:
DocumentPath:
DocumentLength:
ConcurrencyLevel:
Time taken for tests:
Completerequests:
Failedrequests:
Writeerrors:
Totaltransferred:
HTMLtransferred:
Requests persecond:
Time perrequest:
Time perrequest:
Transferrate:
Connection Times (ms)
Connect:
Processing:
Waiting:
Total:
Percentage of the requests served within a certain time(ms)
100%
3 apache的ab工具也算是一种ddos攻击工具
转自:http://www.cnblogs.com/yjf512/archive/2011/05/24/2055723.html