Share your love
Install and Use Siege Stress Tester on Debian 11
In this article, we want to teach you How To Install and Use Siege Stress Tester on Debian 11.
Siege is an open-source regression test and benchmark utility. It can stress test a single URL with a user-defined number of simulated users, or it can read many URLs into memory and stress them simultaneously. The program reports the total number of hits recorded, bytes transferred, response time, concurrency, and return status. Siege supports HTTP/1.0 and 1.1 protocols, the GET and POST directives, cookies, transaction logging, and basic authentication. Its features are configurable on a per-user basis.
How To Install and Use Siege Stress Tester on Debian 11
Before you start to install Siege on Debian 11, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article the Initial Server Setup with Debian 11.
Now follow the steps below to complete this guide.
Install Siege Stress Tester on Debian 11
First, you need to update and upgrade your local package index with the command below:
sudo apt update && sudo apt upgrade
Siege is available in the default Debian 11 repository. So you can install Siege with the following command:
sudo apt install siege -y
Then, you can verify your Siege installation on Debian 11 by checking its version:
siege --version
Output
...
SIEGE 4.0.7
Copyright (C) 2018 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.
Configure Siege Stress Tester on Debian 11
At this point, you need to make some configuration changes to the Siege config file. The main option you will need to change is the log path.
Open the file with your favorite text editor, here we use vi:
sudo vi /etc/siege/siegerc
Find the line below and uncomment it by removing the # from the beginning of the line:
logfile = $(HOME)/var/log/siege.log
When you are done, save and close the file.
These are some useful options of Siege:
- -t: This option is used to set a time limit for which Siege runs.
- -c: This option is used to set the number of concurrent users.
- -d: This option is used to set the delay time for each user.
- -C: This option is used to specify your own configuration file.
- -i: It is used to hit random URLs.
- -T: It is used to set the Content-Type in requests.
- -h: It is used to display help information.
- -l: It is used to generate a log file.
How To Use Siege Stress Tester
At this point, you can test your web server, do note this will pretty much look like a DDOS attack to some firewalls and WAF, so make sure to have permission before using any HTTP benchmarking tool. Ideally, it would be best not to use this except for your servers.
First, you can use siege command and test the default amongst of workers, which is 25 for one minute, by specifying -t 1m
as shown below:
siege https://www.example.com -t 1m
Also, another variable you may want to include is the number of workers, for example -c 100
will add 100 workers.
siege https://www.example.com -c 100 -t 2m
Another feature of Siege is to manage multiple domains. First, open the following file with your favorite text editor, here we use vi:
sudo vi /etc/siege/urls.txt
Next, add the URLs you want to be benchmark tested:
https://www.example.com https://www.example2.com http://192.168.50.1
When you are done, save and close the file.
To execute the multiple website stress test run the following command:
siege -f /etc/siege/urls.txt
Conclusion
At this point, you learn to Install and Use Siege Stress Tester on Debian 11.
Hope you enjoy it.
Also, you may be interested in these articles:
How To Install Wine on Debian 11.