Mac环境下,进行接口压力测试
【摘要】
brew install ctags # 依赖安装wget http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gztar -zxvf webbench-1.5.tar.gzcd webbench-1.5mkdir -pv /usr/local/man/man1 # 必须so...
-
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 权限因为需要创建文件夹
-
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
- 系统默认会开启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
- 解决办法是修改线程数
- 查看mac下最大线程数
-
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个所以就出错了
文章来源: springlearn.blog.csdn.net,作者:西魏陶渊明,版权归原作者所有,如需转载,请联系作者。
原文链接:springlearn.blog.csdn.net/article/details/102425290
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)