Install Siege Stress Test on Ubuntu 20.04

In this guide, you will learn to Install and Use Siege Stress Test on Ubuntu 20.04.

Siege is an HTTP load testing tool that you can use to send hundreds of concurrent visitors on your website at once to check how it will perform under pressure and how much availability your server can provide.

Siege is a very easy-to-use and beginner-friendly tool. It just takes a few commands to install Siege on the Ubuntu server and a single command to start testing the performance of your application.

In benchmark mode, it runs as fast as possible with no delays.

Steps To Install Siege Stress Test on Ubuntu 20.04

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Ubuntu 20.04.

Install Siege on Ubuntu 20.04

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 Ubuntu repository. So you can install Siege with the following command:

sudo apt install siege -y

Then, you can verify your Siege installation on Ubuntu 20.04 by checking its version:

siege --version
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

Configure Siege on Ubuntu 20.04

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 the vi editor:

sudo vi /etc/siege/siegerc

Now 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.

At this point, you can see some useful options for Siege on Ubuntu 20.04:

  • -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 helpful information.
  • -l: It is used to generate a log file.

How To Use Siege Stress Teste

At this point, you can test your web server with Siege on Ubuntu 20.04, do note this will pretty much look like a DDOS attack on 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 the siege command and test the default amongst workers, which is 25 for one minute, by specifying -t 1m as shown below:

siege -t 1m

Also, another variable you may want to include is the number of workers, for example -c 100 will add 100 workers.

siege -c 100 -t 2m

Manage Multiple domains with Siege

Another feature of Siege is to manage multiple domains on Ubuntu 20.04. 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:

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

Run Siege Benchmark

To run Siege in benchmark mode, you can use the -b flag and pass the URL you’d like to benchmark. By default, it will run with 25 threads.

siege -b


At this point, you have learned to Install and Use Siege Stress Test on Ubuntu 20.04.

Hope you enjoy it. Also, for more articles, you can visit the Orcacore website.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!