SourceForge Logo

Hammerhead 2 - Web Testing Tool

What does it do?

Hammerhead 2 is a stress testing tool designed to test out your web server and web site. It can initiate multiple connections from IP aliases and simulated numerous (256+) users at any given time. The rate at which Hammerhead 2 attempts to pound your site is fully configurable, there are numerous other options for trying to create problems with a web site (so you can fix them). It can be used to test the behaviour of the port under load, or the ability of the port to service a set of requests. Warning: Hammerhead can destroy a web site very quickly (and cost you lots of money if you pay for traffic you generate). It should only be used to generate heavy loads on local web sites for testing purposes.

Using Hammerhead

The behaviour of Hammerhead is very configurable. Hammerhead loads a set of requests from a number of files, each of which may contain a number of scenarios (one request per scenario). Scenarios may be linked into sequences, in order to simulate real users actions.

Generating Load

Once the specified scenarios are loaded, Hammerhead starts a number of threads and sends requests to the configured port. Hammerhead can simulate requests from multiple machines by exploiting IP aliasing. Hammerhead can generate a large amount of load on a web server by having a large number of sessions (200+), an IP alias for each session and setting the time between requests to be small (in the order of a second) Because Hammerhead (generally) waits for replies from the web server it will load the web server to capacity and can be used for capacity testing.

Testing

Expected results of an HTTP request may be specified in a scenario, and any result from the port which does not match with the expected result will be reported as an error. If no expected results are specified, then any result from the port will be accepted as valid. Specifying an expected result for any scenario has the effect of specifying the same result for all scenarios which have the same request. Any failure to get a connection to the port, or any failure to receive a reply to a request will also be reported.

The Source Code

The Hammerhead source code is available under the GNU Public License: Download Page

Platforms

Hammerhead has been used with Linux, Solaris and FreeBSD. It would should be relatively easy to port to any Unix environment.

Limitations

Trying to truly simulate users on the web is very difficult. Hammerhead has a number of inherent limitations. Primarily it is limited by the number of IP aliases you can add to your machine and still have it perform reasonably. Typically a big web site will get lots more users than you can generate IP aliases. Secondly Hammerhead (normally) waits on the web server to respond once it has a connection; this can cause Hammerhead to fall below the request rate you've configured for if the web server is running poorly. Really Hammerhead should disconnect from a slow connection and force a "reload" like a "real" user might do. Also data is extracted at full rate from any connections that have been made. Ideally you'd want to be able to control this rate to simulate users on modems (etc). Mick Dwyer has just begun to add in bottleneck simulation code to address some of these concerns but this is currently incomplete.
Geoff Wong
geoff@shattered.org
December-2000.