Categories: TutorialsUbuntu

Load testing on your web server using Siege ( Benchmarking Tool )

It is essential to know how much traffic a web server can handle under stress for future planning. As a developer and IT professional, load testing is the most crucial task to determine the capacity of a website and infrastructure. There are many load testing tools available today such as jMeter, gatling,Apache bench, Siege etc. In this article, we will learn how to use siege to test load on the web server.

Siege is one of the popular HTTP load testing and benchmarking utility tool to measure the performance of web servers under stress. It can be used to evaluate response time of the web server, transaction rate, data transferred, concurrency and throughput.

Sponsored
Installing Siege Load testing tool

Installation of siege benchmarking tool is a simple and easy process. Follow the steps below to install the utility tool in the Linux system.

Ubuntu/Debian

$ apt install siege

RHEL/CentOS

$ yum install epel-release

$ yum install siege

Install from source code

If you want to compile the source code and install the application in the Linux system, follow the steps below.

Install build-essential and development packages to build the source code.

$ apt install build-essential [Ubuntu/Debian]

$ yum install groupinstall ‘Development Tools’ [CentOS/RHEL]

Download the siege source code using wget command.

$ wget http://download.joedog.org/siege/siege-latest.tar.gz

Extract the source code using tar command

$ tar -xvzf siege-latest.tar.gz

Build the application using the following command.

$ cd siege-*/
$ ./configure --prefix=/usr/local --with-ssl=/usr/bin/openssl

$ make && make install

Configure Siege Load testing tool

Once the installation is completed, now we need to adjust siege configuration. Run the following command if you have built the package from the source code.

$ siege.config

Output:

The configuration file is located at the user’s home directory ~/.siege/siege.conf. Use the following command to find the content of the configuration file.

$ cat siege.conf | egrep -v “^$|#”

With the current configuration, 25 concurrent users will be initiated to test the load on the web server.

Testing website load testing using Siege tool

Using siege is very simple and easy. Just specify the name of the website and run the command as:

Sponsored
$ siege linuxways.com

Output:

In this example, 5 concurrent users are being used for 1 minute. If the availability remains 100% without any connection issues, then the web server is in good condition. Also note the response time and successful transactions to evaluate the web server capacity to handle the traffic.

Load testing on multiple websites

Sometimes you may need to run load tests on multiple URLS at a time. For this, create a text file containing urls and execute siege command specifying filename as:

$ cat urls.txt

$ siege -f /root/urls.txt

Output:

Siege provides many command line options to use different settings while performing load tests.

-c – The number of concurrent users

-b – No delays between the requests

-l – Log file

-H – Add a header to request

-r – Number of time to run the test

-f – Test URLS from the specified file

-t – How much time to run the test

Conclusion

In this article, we learned how to test load in web servers using siege benchmarking tools. Also I have covered how to test load on multiple websites creating url files using siege benchmarking tool.

I am a professional WordPress & Graphic designer. I have more than 6 years of experience in this field.

Ubuntu Server Admin

Recent Posts

Ubuntu Weekly Newsletter 866

Welcome to the Ubuntu Weekly Newsletter, Issue 866 for the week of November 10 –…

6 hours ago

Ubuntu vs Debian: Linux Distributions Compared Deep Dive

Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…

15 hours ago

How to Install Google Cloud BigQuery Python client library on Linux

In this article, we will see how to Install Google Cloud BigQuery Python client library…

3 days ago

Wallpaper Contest for Xfce 4.20 open for voting

Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…

3 days ago

Canonical announces the first MicroCloud LTS release

MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…

4 days ago

Join Canonical in Paris at Dell Technologies Forum

Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…

5 days ago