Apache ab测试报 “ab:invalid URL” 错误
转载:https://www.ddkiss.com/archives/43.html
今天用apache2自带的ab性能压测工具对自己的网站进行了简单的测试。看了下说明,照着例子试了下,居然不行。
报错如下:
sa@san:~/software/apache2/bin$ ./ab http://www.baidu.com
./ab: invalid URL
Usage: ./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
-b windowsize Size of TCP send/receive buffer, in bytes
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header for POSTing, eg.
最后查明原因,很可笑。必须在最后加上一个/,像下面这样
ab http://www.baidu.com/