webbench最多可以類比3萬個並發串連去測試網站的負載能力,個人感覺要比Apache內建的ab壓力測試工具好,安裝使用也特別方便。
1、適用系統:Linux
2、編譯安裝:
引用wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
3、使用:
引用webbench -c 500 -t 30 http://127.0.0.1/test.jpg
參數說明:-c表示並發數,-t表示時間(秒)
4、測試結果樣本:
引用Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://127.0.0.1/test.jpg
500 clients, running 30 sec.
Speed=3230 pages/min, 11614212 bytes/sec.
Requests: 1615 susceed, 0 failed.
centos 下安裝會遇到問題:
1. make 時報錯
在安裝編譯webbench的時候,
出現如下錯誤資訊 ctags *.c/bin/sh: ctags: command not foundmake: [tags] Error 127 (ignored) 意思是說缺少ctags命令,我沒有裝了,
運行以下命令即可yum install ctags
2. make install 時報錯
[root@ip-10-146-21-171 webbench-1.5]# make install
install -s webbench /usr/local/bin
install -m 644 webbench.1 /usr/local/man/man1
install: cannot create regular file `/usr/local/man/man1': No such file or directory
make: *** [install] Error 1
直接執行 mkdir -p /usr/local/man/man1 即可