Community Documentation

Drupal Performance Measurement & Benchmarking

Last updated November 5, 2009. Created by rport on July 15, 2008.
Edited by aj045. Log in to edit this page.

Benchmarking in simplistic terms is the process where you compare your current performance with that of a better process to improve the overall standard of performance.

This HOWTO sets out the methods to measure the performance of your web server for site administrators to implement changes to the server or Drupal configuration in order to produce performance improvements.

Measurement

For the purposes of this HOWTO, we are focusing on the use of ab, the Apache HTTP server benchmarking tool. ab is often found pre installed with many Linux distributions, and is designed to give you an impression of how your current Apache installation performs.

For Windows users, the ab tool can usually be found somewhere in the installation path of your Apache-based web server. For example, in WAMP it can be found in c:/<path to WAMP>/bin/apache/Apache<version here>/bin. Using the Windows command prompt (accessible by going to "Start", "Run" and typing "cmd"), navigate to the directory containing ab and then you can use the tool as outlined in the examples below. Alternatively, you can place the path to Apache's bin folder in your PATH variable, thus making the ab tool accessible without the need to navigate to it's directory every time you launch the command prompt.

For the examples below we used the following command;

ab -n 100 -c 10 http://yourserver.com/

Where;

-n
Number of requests to perform for the benchmarking session. (option = 100)
-c
Number of multiple requests to perform at a time. (option = 10)

Optimizing Drupal

By default, Drupal has two settings to improve performace;

  • Page Cache
    The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (init) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.
  • Bandwidth optimizations - Aggregate and compress CSS files
    Some Drupal modules include their own CSS files. When these modules are enabled, each module's CSS file adds an additional HTTP request to the page, which can increase the load time of each page. These HTTP requests can also slightly increase server load. It is recommended to only turn this option on when your site is in production, as it can interfere with theme development.

Where to find Drupal's performace settings

http://yourserver.com/admin/settings/performance

CSS Aggregation OFF, Page Cache OFF

Concurrency Level: 10
Time taken for tests: 35.160824 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1631700 bytes
HTML transferred: 1582800 bytes
Requests per second: 2.84 [#/sec] (mean)
Time per request: 3516.082 [ms] (mean)
Time per request: 351.608 [ms] (mean, across all concurrent requests)
Transfer rate: 45.31 [Kbytes/sec] received

CSS Aggregation ON, Page Cache OFF

Concurrency Level: 10
Time taken for tests: 34.796567 seconds
Complete requests: 100
Failed requests: 1
(Connect: 0, Length: 1, Exceptions: 0)
Write errors: 0
Non-2xx responses: 1
Total transferred: 1469540 bytes
HTML transferred: 1420867 bytes
Requests per second: 2.87 [#/sec] (mean)
Time per request: 3479.657 [ms] (mean)
Time per request: 347.966 [ms] (mean, across all concurrent requests)
Transfer rate: 41.24 [Kbytes/sec] received

CSS Aggregation ON, Page Cache ON

Concurrency Level: 10
Time taken for tests: 5.461753 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1525206 bytes
HTML transferred: 1476505 bytes
Requests per second: 18.31 [#/sec] (mean)
Time per request: 546.175 [ms] (mean)
Time per request: 54.618 [ms] (mean, across all concurrent requests)
Transfer rate: 272.62 [Kbytes/sec] received

See also

External links

Page status

No known problems

Log in to edit this page

Installation Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here