Category Archives: Stress-testing

Under Siege

This one is another FTR: stress-testing with Siege is a breeze! Here are two cites from http://blog.remarkablelabs.com/2012/11/benchmarking-and-load-testing-with-siege:

You can have this benchmark run forever, or you can specify a specific period of time. To set the duration of the test, use the -t NUMm option. The NUMm format is a representation of time. Here are some time format examples:

  • -t60S (60 seconds)
  • -t1H (1 hour)
  • -t120M (120 minutes)

To demonstrate running a benchmark, let’s run Siege against this blog:

siege -b -t60S  http://blog.remarkablelabs.com 

and then also “user emulation”:

 When creating a load test, you should set the -dand -c NUM options. The -d NUM option sets a random interval between 0 and NUM that each “user” will sleep for between requests. While the -c NUM option sets the concurrent number of simulated users.

Here is an example of a load test of a Heroku application:

$ siege -c50 -d10 -t3M http://some.application.com

and you could use custom headers (think cookies) with -H.

And what’s even better, it’s widely available – I’ve installed it on Mac through Ports (although it’s on brew as well) and then unpacked it from RPM on my GoDaddy SSH shell account (because I couldn’t just go and install it there). It worked well in both cases.