Performance

Topic

Overview

An Introduction to Xhprof Ben to try find a good resource. Install with homebrew, use Devel to enable
Blackfire Profiler A web service and profiler built by SensioLabs.
Drupal Performance Overview An overview of all the different technologies that fit into "Performance"
High Performance Drupal (book) Should be a copy both in the office and in Google Drive.
MySQL Query Optimisation A great overview of the basics of MySQL query performance including common pitfalls within Drupal
MySQL Tuner A script to detect common misconfigurations for MySQL setups
Opcache Fine Tuning An advanced look at PHP's opcache.
Drupal Performance Checklist Simple checklist of things to check for easy performance wins in Drupal
Performance resources A comprehensive list of performance resources.

 

Drupal Performance Tips

  • Use #pre_render and #cache on renderable arrays.
  • Avoid variable_set because it clears the cache and causes a rebuild on next request which can be very hard to debug.
  • Use Drupal's Lock API to avoid cache stampedes.
     

MySQL Performance Tips

  • Indexes are only used when the first part of the index is in the query.
  • Indexes are ignored with range queries, e.g. > and <
  • Always use the smallest base table first.