Categories: Ubuntu

How to install Siege on Ubuntu

Siege is an open-source regression test and benchmark utility used to stress test a website URL with several simulated users accessing a website. Developers can check the performance of their code using Siege. It works by hitting a web server simultaneously with many concurrent users. These users put the webserver under stress for a configurable period or until a manual interrupts the user running the Siege program.

What will we cover?

In today’s guide, we will learn about the Siege benchmarking tool. We will see how to install and use it with Ubuntu 20.04. Let us quickly learn the basic overview of Siege.

Attention: Please read the note below before attempting to run this guide in a real-life environment:

“ It should be noted that Siege is a stressing tool as such it generates a heavy load on the server it is targeted to; hence you should not use it against any website or server without the owner’s permission. If you do so, you may put yourself in trouble as you have illegally DDoSed a third website or server without their consent.”

Performance Metrics of Siege

Critical performance metrics for analysis provided by Siege benchmarking tool can be broadly classified as:

Availability: It gives the percentage of socket connections which the server has successfully handled. It is calculated by the number of socket failures (including timeouts) divided by the total of all connection requests. The result does not comprise 400 and 500 range server errors included in “Failed transactions”.

Total Transactions: It is the number of server hits. By default, there are 25 simulated users, each of which strikes the target server 10 times, giving 250 transactions. The number of transactions can exceed the number of strikes because Siege computes every server strike a transaction, i.e., redirections and authentication strikes are computed as two hits. Siege sticks to the HTTP specification, and it emulates the behavior of a browser.

Response Time: It is the average time taken for responding to the requests of each simulated user.

Transaction Rate: It is the average number of transactions the server can handle in a duration of a second or transactions divided by total time passed.

Throughput: It is defined as the mean number of bytes transmitted per second by the server to every simulated user.

Successful Transactions: It is the number of times the server acknowledged with a return code smaller than 400.

Failed Transactions: It is the number of times the server acknowledged with a return code greater than or equal to 400, including all the failed socket transactions with socket timeouts.

Elapsed Time: It is the duration for which the Siege tool runs the test. It is calculated from the time the Siege is started till a simulated user finishes its transactions.

Data Transferred: The total amount of data transferred to every simulated user of the Siege test. It comprises the header information and content of the data packet.

Concurrency: It is the mean number of concurrent connections. It increases as server performance decreases.

Longest transaction: It is the longest time that a single transaction can take from among all the transactions.

Shortest transaction: It is the shortest time that a single transaction can take from among all the transactions.

Installing Siege on Ubuntu 20.04

  1. To install Siege on your system, first update the repository lists:
  2. sudo apt update -y
  3. Now install Siege from Ubuntu’s default repository using:
  4. sudo apt install siege -y

  5. To check the installed version of Siege, use the command:
  6. siege –version

Using Siege

The syntax for using siege is:

  1. siege [options]
  2. siege [options] [url]
  3. siege -g [url]

Siege has many command-line options, as shown in the table below.:

-V or –version Outputs the version number
-h or –help/td> Prints the summary of all command-line options.
-C or –config Displays the configuration present in $HOME/.siegerc file.
-v or –verbose Provides verbose on-screen output like HTTP return status and GET request.
-b or –benchmark YBenchmarking test is done with zero delays.
-t or –time GUsed to specify the duration of time for a test
–reps GUsed for specifying the number of times you want to repeat a test.

Experimental Setup

Let us deploy an Apache web server on one of the machines (With IP address 192.168.42.216) and run a Siege test against it from another machine.

  1. In its simplest way, we can run the Siege test on a web server by simply using the server’s IP address or its domain name. It will run the test with the default configuration as shown below:
  2. sudo siege 192.168.42.216

  3. To run the test for 40 seconds, use the format below:
  4. sudo siege -t40S http://192.168.42.216

  5. To run the test for 30 concurrent users, use the format below:
  6. sudo siege -c30 http://192.168.42.216

  7. To run the test for 40 seconds and 30 concurrent users, use the format below:
  8. sudo siege -t40S -c30 192.168.42.216

Conclusion

In this guide, we learned about installing and using the Siege benchmarking tool. Try to explore more possibilities with Siege by using different options.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

2 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

5 days ago