This module provides some statistics and other data helpful when sizing a hosting environment.

The following information is collected:

  • Environment information: basic PHP, MySQL information, php.ini parameters.
  • Performance data: average, min and max page requests/sec, breakdown of page views from anonymous vs. authenticated users.
  • MySQL database: mysql_stat output, database size, node and user counts.
  • Filesystem: File count and total size (from site's files directory).

The information can be viewed from within Drupal, emailed as text to a designated recipient, or (using Drush) exported as CSV.

Caveats:

  • [Drupal 6 Only] Because the logging function runs in hook_exit(), performance logging for anonymous users will not be accurate when Aggressive caching is enabled. It works fine with Normal caching.
  • Only pages generated by Drupal will be counted. Standalone PHP pages or static files will not. To get a more complete HTTP reqests/sec picture, you'll have to fall back on log file processing, or using an external analysis tool such as Cacti or Munin.
  • If a reverse proxy cache such as Varnish or Squid, or a CDN is used, request stats reported by this module may be lower than true page views, again because we're only tracking pages that Drupal is building for users.
  • Module only supports MySQL at present. Logging should work with postgres, but database stats won't.

Since calculation of some of these statistics may themselves cause performance issues, there are permissions for both running and viewing calculations. It is suggested that calculations are run at off-peak times for very large or high-traffic sites.

Installation

Installation is the same as most other Drupal modules - unpack the archive file to your modules directory, then enable it at http://YOURSITE?q=admin/build/modules.

Usage

The module is intended to provide site owners with a snapshot of Drupal site configuration and load in order to allow hosting companies to accurately configure a hosting environment, and to suggest areas where optimization may be appropriate to improve Drupal performance.

Note that the Hosting Diagnostics performance data capture is only effective in determining page views generated by Drupal itself. If your sites utilize Content Delivery Networks (CDNs), reverse proxy caching such as Squid or Varnish, these numbers will not be included in your page load data. Additionally, static files such as Javascript, Images, stylesheets (CSS) will not be counted in these metrics. If possible, please utilize your web server logs to furnish a complete traffic picture. Tools such as AWStats (http://awstats.sourceforge.net/) can be used to compile reports from web server log files.

Running reports

You should choose a period of time that will be representative of your average site traffic - i.e. for a news site, you may wish to choose a Monday, and run performance logging for a 24 hour period to achieve coverage of your overall traffic. If your site has lower traffic, or highly variable traffic, you may wish to run logging for a longer period of time.

  1. Enable performance logging at http:///admin/settings/hosting_stats. Set "Capture peformance data" to "On". You may also choose to adjust the "Performance log limit", which will set an upper bound on the number of records that are retained in the database, but this is generally not necessary.
  2. Visit the reporting page at http:///admin/reports/hosting_stats. At any time you may choose to run one or all of the reports. Be aware that some of the reports may be database-intensive, and should preferably be run at off-peak traffic times. You may click the "Calculate _____ statistics" button under each test section, or click the "Calculate all statistics" button at the bottom of the form to run all reports.
  3. Once satisfied that you've captured sufficient data, you can send data to the email address configured as the hosting provider by clicking the "Send to host" button at the bottom of the page. This will send the output of the report in a text format. Note that we do NOT include any information about your users identities or content.

Drush Integration

Hosting Diagnostics also allows most operations to be performed from Drush.

The following commands are available: hd-enable hd-disable hd-calculate hd-clearlog hd-stats

Use drush help <command> to view help for each Drush command.

Roadmap

This module is intended to supplement rather than replace the Devel and System Info modules, though there is a bit of overlap.

Project information

Releases