banner
moeyy

moeyy

一条有远大理想的咸鱼。
github
mastodon
email

Various website stress testing tools webbench, siege

①.webbench installation and usage

Install webbench on Ubuntu

  1. Install dependency package CTAGS
apt-get install ctags
  1. Install Webbench
wget --no-check-certificate https://cangshui.net/-down/-mytargz/webbench-1.5.tar.gz && tar  -zxvf webbench-1.5.tar.gz && cd webbench* && make && sudo make install

webbench usage:

webbench -c 65535 -t 60 IP or URL example:

webbench -c 65535 -t 60 http://baidu.com  (test Baidu for 60 seconds with a packet size of 65535)

Test static image:

webbench -c 65535 -t 60 http://www.baidu.com/img/bd_logo1.png

webbench test result

Webbench – Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://www.baidu.com
500 clients, running 30 sec.

Speed=3230 pages/min, 11614212 bytes/sec.
Requests: 1615 succeeded, 0 failed.

Analysis: Number of requests responded per second: 3230 pages/min, data transferred per second: 11614212 bytes/sec.

②.siege stress testing tool compilation and installation

siege gives me the feeling of being a simple software for simulating access, it does not put much pressure on the client, mainly used for analyzing access data. It can record the response time of each user's request process and repeat it under a certain amount of concurrent access.

siege compilation and installation

yum install -y openssl  #openssl needs to be installed first to support https
wget --no-check-certificate https://cangshui.net/-down/-mytargz/siege-latest.tar.gz && tar -zxvf siege-latest.tar.gz && cd siege-4.0.4 && ./configure --prefix=/root/siege --with-ssl=/usr/lib64/openssl && make && make install

Ubuntu/debian installation siege :

sudo apt-get update && sudo apt-get upgrade  --show-upgraded
Update the system if necessary
sudo apt-get install siege
Very convenient, but the version is slightly outdated

Usage example/method:

#Simulate 252 users, web request interval 1 second, run for 60s
siege -d 1 -c 252 -t 60 https://baidu.com
#You can also create a test list xx.txt
siege -d 1 -c 252 -i -f xx.txt

Parameter explanation

    -C, or -config Print and display the current configuration on the screen. The configuration is included in the configuration file $HOME/.siegerc. You can edit the parameters in it, so that each siege will run according to it.
    -v Detailed running information can be seen at runtime
    -c n, or -concurrent=n Simulate n users accessing at the same time. Do not set n too large, because the larger n is, the more resources siege consumes on the local machine.
    -i, -internet Randomly access the url list items in urls.txt to simulate real access conditions (randomness). This is valid when urls.txt exists.
    -d n, -delay=n Delay between hitting each url, between 0 and n
    -r n, -reps=n Repeat the test n times, cannot exist at the same time as -t
    -t n, -time=n Run siege for 'n' seconds (e.g. 10S), minutes (10M), hours (10H)
    -l After running, save the statistical data to the log file siege.log, generally located in /usr/local/var/siege.log, can also be customized in .siegerc
    -R SIEGERC, -rc=SIEGERC Specify a specific siege configuration file to run, the default is $HOME/.siegerc
    -f FILE, -file=FILE Specify a specific urls file to run siege, the default is urls.txt, located in the etc/urls.txt directory under the siege installation directory
    -u URL, -url=URL Test a specific URL and "siege" it. This option ignores the settings of the urls file.
    urls.txt file: It is a list of many lines of URLs to be tested, separated by line breaks, in the format of:
    

This article is based on the "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)" license agreement. Please indicate when reprinting original articles: Cangshui's Blog » Various website stress testing tools webbench, siege

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.