title: 压力测试工具webbench
date: 2020-07-21 10:41:00
categories:

  • 工具
    tags:
  • webbench
  • 压力测试工具

系统信息

  1. CentOS 8.2 64

安装过程

  1. wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
  2. tar -zxvf webbench-1.5.tar.gz
  3. cd webbench-1.5
  4. make && make install

遇到问题:

  • webbench.c:21:10: fatal error: rpc/types.h: No such file or directory

    • 压力测试工具 - 图1
    • 解决办法:cp /usr/include/sys/types.h /usr/include/rpc/
  • /bin/sh: ctags: command not found make: [Makefile:12: tags] Error 127 (ignored)

    • 压力测试工具 - 图2
    • 解决办法:yum -y install ctags
  • install: cannot create regular file '/usr/local/man/man1': No such file or directory

    • 压力测试工具 - 图3
    • 解决办法:mkdir /usr/local/man

使用

  1. webbench -c 1000 -t 60 http://192.168.80.157/phpinfo.php
  1. webbench [option]... URL
  2. -f|--force Don't wait for reply from server. // 不要等待服务器的回复.
  3. -r|--reload Send reload request - Pragma: no-cache. // 发送重新加载请求-语法: no-cache.
  4. -t|--time <sec> Run benchmark for <sec> seconds. Default 30. // 运行基准测试<sec>秒。 默认30.
  5. -p|--proxy <server:port> Use proxy server for request. // 使用proxy服务进行请求.
  6. -c|--clients <n> Run <n> HTTP clients at once. Default one. // 一次运行<n> HTTP客户端。 默认一个.
  7. -9|--http09 Use HTTP/0.9 style requests. // Use HTTP/0.9 样式请求.
  8. -1|--http10 Use HTTP/1.0 protocol. // Use HTTP/1.0 协议.
  9. -2|--http11 Use HTTP/1.1 protocol. // Use HTTP/1.1 协议.
  10. --get Use GET request method. // 使用GET请求方法.
  11. --head Use HEAD request method. // 使用HEAD请求方法.
  12. --options Use OPTIONS request method. // 使用OPTIONS请求方法.
  13. --trace Use TRACE request method. // 使用TRACE请求方法.
  14. -?|-h|--help This information.
  15. -V|--version Display program version.

另外:不支持https,只支持http