How to benchmark a website with the CIS command-line tool

March 30, 2022 0 Comments

Need a stress-test to see how well your websites are performing? Jack Wallen shows you how to use the command-line siege tool.

open-source-linux-code.jpg
Photo: iStock

If you are a web administrator, one of your constant challenges is optimizing the sites so that they perform at their best. After all, a slow website can easily turn off clients and customers. In order to optimize these sites, you may want to first benchmark them to see how well (or badly) they work.

Views: Recruitment Kit: JavaScript Developer (TekriPublic Premium)

A tool to help your website benchmark is the command-line application, CZ. Siez Web Server performs load testing and gives you full details:

  • Number of hits recorded
  • The amount of bytes transferred
  • Response time
  • Consistency
  • Return status

CIS supports both HTTP / 1.0 and 1.1 protocols, GET and POST guidelines, cookies, transaction logging, and basic authentication.

Let’s install CZ on Pop! _OS Linux and check a website stress.

What you will need

The only things you need to follow are a Ubuntu-based distribution, a user with pseudo features and a website to test.

That’s it. Let’s make some noise.

How to install Siege

CJT is available in standard Ubuntu repositories, so all you have to do is open a terminal window and issue the command:

sudo apt-get install siege -y

After installation, let’s enable logging. To do this, open the configuration file with:

sudo nano /etc/siege/siegerc

In that file, look for the line:

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

Change this line:

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

Save and close the file.

How to perform a stress test

All we’re going to do is run a 5-minute stress test and increase the load of the adjacent user to the default 25 to 100. This is done with the command:

siege https://SERVER -c 100 -t 5m

Where SERVER is the IP address or domain of the server to be checked Once the five-minute test is over, Ciz will report its results to both terminals (Figure A) And log files.

Figure A

Siege has completed a site test on my local LAN.
Siege has completed a site test on my local LAN.

If you want to create a log file to test CJ, you need to run it:

siege https://SERVER -c 100 -t 5m -l

Where SERVER is the IP address or domain of the server to be checked Also, if you see Siege showing an error not being able to write to the default log file (and it shows /var/log/log/siege.log as a file), you will need to edit a different configuration file command:

nano ~/.siege/siege.conf

In that file, uncomment the log file line and go with your log.

How to test multiple sites at once

Suppose you have a lot of sites that you want to test at once. To do this we will create a file with a list of sites Create file with:

nano ~/siege-sites.txt

To that file, add each site, one line at a time like this:

www.example.org

192.168.1.151

Save and close the file. You can then take a siege against these sites:

siege -f ~/siege-sites.txt

Siege will then run default tests against all sites included in the txt file.

And here’s how to stress-check your websites with the Siege command-line tool. Use the results to find ways to improve the performance of your administered sites

Subscribe to TechRepublic How to do tech work on youtube From Jack Wallen to Business Professionals for all the latest technology advice.

Leave a Reply

Your email address will not be published.