Drupal 6 Performance Tips Review

Packt Publishing's ever growing Drupal bookshelf expanded with Drupal 6 Performance Tips in February. The book rightly earned its title from being some tips without trying to pin down a comprehensive guide. Maybe even better titling would have been to attach a "for beginners" to the end. Contents of the book really cater for beginners with little coverage of topics outside Drupal's (and some major contributed modules) own internal solutions to performance problems. Its subtitle hints that it provides best practices which I'd respectfully dispute.

What's entirely surprising is that the 220 page volume starts off with 50 pages on upgrading a Drupal 5 site to Drupal 6. While the most current performance tweaks are usually documented for latest versions of Drupal, assuming the reader must have started off with an old Drupal site might not be the best way to set the tone for the book. However, the author comes back to upgrading modules regularly at a later stage in the book, which I've valued. It clearly underlines the need to come back and update your environment once in a while. (That module upgrade explanation is at an absolutely unexpected point in the book, which makes it even better positioned).

There is no coverage of actual performance related content until page 59th though, where Drupal's page, CSS and JS caching is explained. Unfortunately the author takes too much time explaining running cron by hand and using poormanscron (with this later module even revisited and reinstalled later in the book). There is little mention that you might actually be able to set up your cron via your host, at least via cPanel or Plesk.

Deep coverage is included about the Devel module. Unfortunately only ways to see where your database bottlenecks are is shown, without hints as to how to fix them. Some notes could easily get you into the woods unless you read critically. The author suggests running phpinfo(); in the Devel module Execute PHP code input, which will only get you confusing HTML markup. Not much use given the book already covers two other places where you can actually get useful phpinfo. The hooks_elements() feature is explained that it "launches a page that displays all your hook arrays". Not really, it gives you details of elements defined by Drupal and the installed modules.

Another perplexing example from page 97 is the misleading suggestion to monitor the cache generation times, and if the page generates quicker without the cache being enabled, disable caching. However, the book lacks pointing out that while the cache generation and storage will actually take more time, its usefulness is that its served multiple times in the future. Similarly extensive coverage of the throttle module mentions that you might want to throttle the Views module, but not CCK, so "your users can still see the content that is being filtered into a View". They'll not be able to navigate to your content though, huh. Also, throttling contact and database logging might not be the best idea contrary to what the book suggests, as it cuts the line from your site users to reach you in emergency and from your error logs to your debugging session to figure out why was the site so slow. Anyway, throttle module's performance approach is definitely outdated and is not going to be included with Drupal 7 for good.

The most extensive chapters in the book are on Boost. You get some basic Boost education with related modules included. Another major surprise included here is the suggestion to add Rules module to your site just so that you can run cron when a node is updated, so it updates your Boost cache. It's not only the overkill of a complete module suite for a very simple action it also suggests you to run cron via the drupal_http_request() function which initiates an HTTP request instead of just invoking the cron hooks.

Finally, the only external tool mentioned that is outside Drupal core and contributed modules is Memcache which is explained in a self-setup local Windows environment. For a book on Drupal performance, I'd have expected coverage on Drupal specific performance and scalability solutions like Pressflow, educated module selection and usage (instead of just trying to throttle pieces out), active use of database runtime feedback to tweak features on the site (even if not SQL query tweaking as that was clearly out of focus for the target group). Advanced topics could have included database server tweaking, use of multiple database servers, multiple web servers, load balancing, proxy servers, bytecode caching (if we can consider that advanced in these days), front end performance considerations, CDNs, etc. While these are more general purpose performance topics, they all can and should have Drupal specific considerations when applied.

I'd also suggest reading the review comments on the drupal.org post about this book for anybody considering if this is the right book them them.

Comments

everyz's picture

You may also find interesting this drupal performance tips site: http://drupalperformanceblog.com

Add new comment