Webbench under ubuntu for website stress test tutorial [webbench installation]

  Webbench can simulate up to 30,000 concurrent connections to test the load capacity of the website. I personally feel that it is better than the ab stress test tool that comes with Apache, and it is particularly convenient to install and use.

1. Installation Tutorial

1.1 Installation depends on exuberant-ctags

sudo apt-get install exuberant-ctags

1.2 Download the source code and install

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 && sudo make install

Insert picture description here
Insert picture description here

Note: If you are prompted to make cc command not found, you need to install the c/c++ compilation environment linux

sudo apt-get install build-essential

1.3 Frequently used methods and instructions

webbench -c 500  -t  30  http://127.0.0.1:3006/
参数说明:-c表示并发数,-t表示时间()

Note: http://127.0.0.1:3006/ is a website written by me.
Insert picture description here
It can also be tested on Baidu:
Insert picture description here
so many failures may be due to Baidu's ip monitoring. After all, big companies, well, actually I don’t knew!

1.4 Running webbench will output instruction usage

webbench [option]... URL
  -f|--force               Don't wait for reply from server.
  -r|--reload              Send reload request - Pragma: no-cache.
  -t|--time <sec>          Run benchmark for <sec> seconds. Default 30.
  -p|--proxy <server:port> Use proxy server for request.
  -c|--clients <n>         Run <n> HTTP clients at once. Default one.
  -9|--http09              Use HTTP/0.9 style requests.
  -1|--http10              Use HTTP/1.0 protocol.
  -2|--http11              Use HTTP/1.1 protocol.
  --get                    Use GET request method.
  --head                   Use HEAD request method.
  --options                Use OPTIONS request method.
  --trace                  Use TRACE request method.
  -?|-h|--help             This information.
  -V|--version             Display program version.

1.5 Principle

Webbench first forks out multiple sub-processes, and each sub-process loops for web access testing. The child process informs the parent process of the access result through the pipe, and the parent process makes the final statistical result.

Reference: https://cloud.tencent.com/developer/article/1478832

Guess you like

Origin blog.csdn.net/zou_albert/article/details/115368710