08 May 2012

The standard Drupal stack has a reverse proxy server in front of the web server, and then Drupal also has a page cache. To test optimizations, however, you need to bypass both so that Drupal processes the full request.

At least for my infrastructure, one way to bypass all of the caching is to test POST requests. This biases the benchmark slightly due to the extra data being transmitted, but that can obviously be minimized. Since I want to run the same benchmark over time, I simplified it to a file named "run.sh":

ab -n 20 -c 5 -p run.sh http://example.com/

The benchmark script posts itself using "-p run.sh" to the web address being tested. While a secondary smaller file could work, this keeps the test simple and self-contained. The other parameters (-n and -c) are just what I happened to use for testing.


blog comments powered by Disqus