Benchmarking is essential for any webmaster to measure and test the performance of a website or web application. It will give you an idea about the amount of data transferred, transaction rate, throughput, and concurrency. This information will help you to improve website speed and grow your website.

There are a lot of benchmarking tools available in the market. Siege is a free, open-source, and cross-platform HTTP load testing and benchmarking tool that can be used to measure the speed of your website and provides a summary of the performance.

In this post, we will explain how to install and use Siege to test the speed of your website.

Step 1 – Install Siege

In this section, we will show you how to install Siege on Debian and RPM-based distributions.

For Debian and Ubuntu operating system, install Siege with the following command:

apt-get install siege -y

For RHEL, CentOS, and Fedora operating system, install Siege with the following command:

yum install epel-release -y
yum install siege -y

Once Siege is installed, verify the installed version of Siege with the following command:

siege --version

You should get the following output:

SIEGE 4.0.4

Copyright (C) 2017 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.

Step 2 – Basic Syntax

Basic syntax of the Siege command is shown below:

siege [option] website-name

A brief explanation of each option is shown below:

  • -v: Enable verbose mode.
  • -c: Specify the number of concurrent users.
  • -t: Specify a time limit for Siege run.
  • -d: Specify the delay for each Siege user.
  • -f: Specify the file containing the list of websites.
  • -i: Used to generate a log file.
  • -r: Define how many times to run the test.
  • -A: Define a user agent.

Step 3 – Configure Siege

The Siege configuration file is located at /etc/siege/siegerc. You will need to edit it and define the path of the log.

nano /etc/siege/siegerc

Find the following line:

logfile = $(HOME)/var/log/siege.log

Replaced it with the following line:

logfile = /var/log/siege.log

Save and close the file when you are done.

Step 4 – Perform Load Test with Siege

In this section, we will show you how to perform a load test for a single website and multiple websites.

Test a Single Website

Let’s test the website www.example.com by simulating 10 users with a delay of up to 10 seconds between requests.

siege -c10 -d10 -r1 -v www.example.com

You should see the following output:

** SIEGE 3.0.5
** Preparing 10 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200   0.00 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.00 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.00 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
HTTP/1.1 200   0.01 secs:    3256 bytes ==> GET  /
done.

Transactions:		          10 hits
Availability:		      100.00 %
Elapsed time:		        8.01 secs
Data transferred:	        0.03 MB
Response time:		        0.01 secs
Transaction rate:	        1.25 trans/sec
Throughput:		        0.00 MB/sec
Concurrency:		        0.01
Successful transactions:          10
Failed transactions:	           0
Longest transaction:	        0.01
Shortest transaction:	        0.00

Test Multiple Websites

Siege also allows you to test multiple websites at a time. In this case, you will need to define all your website name, URL or IPs in the /etc/siege/urls.txt file:

nano /etc/siege/urls.txt

Add the following line:

www.atlantic.net
https://google.com
172.16.0.123

Save and close the file.

Next, test the load of all website defined in the urls.txt file run the following command:

siege -c10 -d10 -r1 -v -f /etc/siege/urls.txt

Conclusion

In this guide, you learned how to install and use the Siege tool to benchmark and load test your website. I hope this will give you enough information to get an idea about your website performance – try it on dedicated hosting from Atlantic.Net.