web load testing with siege on CentOS 5

Recently I’ve needed to do some heavy load/stress testing of a web service at work. We have an API load test tool, but it’s designed to hit our soap server. I needed to hit a javascript file through our new load-balancer – and hit it hard.

We started with Apache Bench (ab) which worked well enough until we realized that it wasn’t doing ssl. The address uses https protocol. So I did a bit of research and found seige.  It’s an ideal tool for this purpose – easy to use from the command line and also supports a configuration file.

Here’s some basic instructions to get it up and running on CentOS 5:

  • Get the latest version:

$ wget ftp://ftp.joedog.org/pub/siege/siege-latest.tar.gz

  • expand the archive
  • make sure you have the ssl libs installed:

$ sudo yum install mod_ssl openssl

  • cd into the siege directory
  • build and install:

./configure --with-ssl=/usr/bin/openssl
sudo make install

  • confirm:

siege -V

  • Note: the instructions suggest installing the tool in a more obvious place that the default, but I didn’t do that.
  • Now you can copy the sample siegerc to your home directory to change the default options:

$ cp docs/siegerc ~/.siegerc
$ cd ~
$ vim .siegerc

  • The default siegerc file is well documented and easy to configure.
  • Time to run it:

$ siege https://www.[yoursecuresite].???

Here’s an example summary report that you get after the test is done or stopped:
HTTP/1.1 200 0.08 secs: 7914 bytes ==> /index.html

Lifting the server siege... done.
Transactions: 311 hits
Availability: 100.00 %
Elapsed time: 1.13 secs
Data transferred: 2.35 MB
Response time: 0.11 secs
Transaction rate: 275.22 trans/sec
Throughput: 2.08 MB/sec
Concurrency: 30.55
Successful transactions: 311
Failed transactions: 0
Longest transaction: 0.35
Shortest transaction: 0.02


Leave a Reply