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

[转]Apache ab 介绍

简介

ab的全称是ApacheBench Apache 附带的一个小工具专门用于 HTTP Server benchmark testing可以同时模拟多个并发请求。

?例子

/*在这个例子的一开始,我执行了这样一个命令 ab -n 10 -c 10 http://www.google.com/这个命令的意思是启动 ab ,向 www.google.com 发送10个请求(-n 10)?,并每次发送10个请求(-c 10)——也就是说一次都发过去了。跟着下面的是 ab 输出的测试报告,红色部分是我添加的注释。*/

C:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -n 10 -c 10 http

://www.google.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.google.com (be patient).....done

?

?

Server Software:??????? GWS/2.1

Server Hostname:??????? www.google.com

Server Port:??????????? 80

?

Document Path:????????? /

Document Length:??????? 230 bytes