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

APACHE自带的测试工具AB进行压力测试

不知道该如何测试APACHE的性能,可以参考APACHE自带的测试工具AB(apachebenchmark).APACHEbin目录下。
格式:./ab [options] [http://]hostname[:port]/path
参数:

??? -n requests???? Number of requests to perform
???//
在测试会话中所执行的请求个数。默认时,仅执行一个请求

??? -c concurrency? Number of multiple requests to make
???//
一次产生的请求个数。默认是一次一个。?
??? -t timelimit??? Seconds to max. wait for responses
???//
测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
??? -p postfile???? File containing data to POST
???//
包含了需要POST的数据的文件.?

??? -T content-type Content-type header for POSTing
???//POST