压力测试工具ApacheBench使用体会

来源:互联网 发布:软件外包网 编辑:程序博客网 时间:2024/05/16 15:35

一、简介

ApacheBench,简称ab,是 Apache 附带的一个小工具,专门用于 HTTP Server 的压力测试。

二、使用方法

最常用的使用方法如下:

ab -n 10 -c 10 http://www.google.com

这个命令表示向www.google.com发送10个请求,一次并发请求数为10次,即一次发送完10个请求。

所有可用参数如下:

Usage: /usr/local/apache/bin/ab [options] [http://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make -t timelimit Seconds to max. wait for responses -p postfile File containg data to POST -T content-type Content-type header for POSTing -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -V Print version number and exit -k Use HTTP KeepAlive feature -h Display usage information (this message)



原创粉丝点击