Drupal Performance Measurement & Benchmarking
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 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
