brew install ctags # 依賴安裝
wget http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gz
tar -zxvf webbench-1.5.tar.gz
cd webbench-1.5
mkdir -pv /usr/local/man/man1 # 必須
sodo make && sudo make install # sudo 權限因為需要創(chuàng)建文件夾
liuxin@KK-MINI ~/webbench/webbench-1.5 mkdir -pv /usr/local/man/man1
liuxin@KK-MINI ~/webbench/webbench-1.5 sudo make && sudo makeinstall
make: Nothing to be done for `all'.
install -s webbench /usr/local/bin
install -m 644 webbench.1 /usr/local/man/man1
install -d /usr/local/share/doc/webbench
install -m 644 debian/copyright /usr/local/share/doc/webbench
install -m 644 debian/changelog /usr/local/share/doc/webbench
webbench -c 50 -t 30 http://127.0.0.1:6969/shenghuojiaofei/test
- 系統(tǒng)默認會開啟1500個端口,所以如果大于1500也會出錯
- 當設每秒進行800連接時候
? liuxin@KK-MINI ~ webbench -c 800 -t 1 --get http://localhost:6969/shenghuojiaofei/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://localhost:6969/shenghuojiaofei/
800 clients, running 1 sec.
problems forking worker no. 539
fork failed.: Operation timed out
prompt_status:5: fork failed: resource temporarily unavailable
- 解決辦法是修改線程數(shù)
- 查看mac下最大線程數(shù)
liuxin@KK-MINI ~ ulimit -u 10000
ulimit: value exceeds hard limit
? liuxin@KK-MINI ~ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 709
-n: file descriptors 4864
liuxin@KK-MINI ~
因為我用了800個所以就出錯了