Siege Testing Your Site Behind a Login

I use Siege to test my web applications and get an idea of how much traffic they can sustain. It is a great tool and I suggest you read more about it here.

A few days ago, I needed to test a part of my application that was behind a login. I hit up UPHPU user group on IRC, and Carmony (a master website optimizer) suggested logging in on my browser and then hijacking the session in siege by setting header values. That is a great idea, but seems overly difficult. I doubted that I was the only one that ever wanted to do this. Isn’t there an easier way?

Sure enough, I found the answer on Server Fault:

http://serverfault.com/questions/292679/stress-login-area-with-siege

Siege has a setting in the .siegerc file for this very scenario, although it isn’t documented.

Simply set the login-url value with a user and password and it will login for you and perform the tests.

login-url = http://YourSite.com/login.php POST name=Clint&pass=MyPassword

So cool!