If you want to stress test your application, the quickest and best way to do so is with siege. From the siege website:
Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It lets its user hit a web server with a configurable number of simulated web browsers. Those browsers place the server “under siege.”
brew install siege
Now you can stress test a given app by simply using the siege command:
siege -c 10 -n 10 http://www.example.com/
I would always recommend that they send a session header in the config, but today I learned there is an even easier way (although undocumented), thanks to this question in Server Fault. In your siege’s configuration you can add the login-url directive:
# Login URL. This is the first URL to be hit by every siege # client. This feature was designed to allow you to login to # a server and establish a session. It will only be hit once # so if you need to hit this URL more then once, make sure it # also appears in your urls.txt file. # # ex: login-url = http://eos.haha.com/login.jsp POST name=jeff&pass=foo # # login-url =
Awesome! Now each connection will authenticate before continuing their siege. A very handy tool, especially if your load is generated by user account pages and such.