Tags
black swan business caching Collaboration Content Management customer underground daas dbpedia drupal Drupal Uriverse DBpedia Solr facebook gpl hosting location mailchimp mapping mercury mobile modules multisite PayPa performance plugin pressflow progressive enhancement Publishing randomness ratings rdfa responsive web design reviews saas scalability semanticweb Social Subscription themes topicmaps uriverse wikipedia wordle wordpress


Drupal Benchmarking (part 11)
Benchmarking a system is a reliable way to compare one setup with another and is particularly helpful when comparing different server configurations. We cover a few simple ways to benchmark a Drupal website.
A performant system is not just one which is fast for a single request. You also need to consider how the system performs under stress (many requests) and how stable the system is (memory). Bechmarking with tools such as ab allows you to stress the server with many concurrent requests to replicate traffic when a site is being slashdotted. With a more customised setup they can also be used in more sophisticated ways to mimic traffic across a whole site.
Apache Bench (ab)
ab is the most commonly used benchmarking tool in the community. It shows you have many requests per second your site is capable of serving. Concurrency can be set to 1 to get end to end speed results or increased to get a more realistic load for your site. Look to the “failed requests” and “request per second” results.
In order to test the speed of a single page, turn off page caching and run ab with concurrency of one to get a baseline.
ab -n 1000 -c 1 http://drupal6/node/1To check scalability turn on the page cache and ramp up concurrent connections (10 to 50) to see how much the server can handle. You should also make sure keep alives are turned (-k) on as this leads to a more realistic result for a typical web browser. At higher concurrency levels making new connections can be a bottleneck. Also, set compression headers (-H) as most clients will support this feature.
ab -n 1000 -c 10 -k -H 'Accept-Encoding: gzip,deflate' http://drupal6/node/1JMeter
JMeter is a Java desktop app designed to test function and performance. It is the preferred testing tool of many administrators.
Thoughts on benchmarking
Benchmarking is essential if you wish to have an objective comparison between different setups. However, it is not the final measurement with regards to performance. Remember that page rendering times are what are important for users and that too needs to be optimized. Also, benchmarks tend to be artificial in the sense that they often measure unrealistic situations. Will all of your requests be for one anonymous page only? Maybe in the Slashdot situation but there are other considerations obviously. Finally, it is easy to focus intently on the number, especially when it comes to caching scores, and forget that minor differences may not make so much of a difference to real life scenarios. Don’t forget the logged in user.
This article forms part of a series on Drupal performance and scalability. The first article in the series is Squeezing the last drop from Drupal: Performance and Scalability.