Book Image

Drupal 6 Performance Tips

By : T J Holowaychuk, Trevor James
Book Image

Drupal 6 Performance Tips

By: T J Holowaychuk, Trevor James

Overview of this book

<p>Drupal is one of the most respected and widely used open source content management frameworks.&nbsp; Small, medium, and large-scale websites are built using Drupal and the framework supports ecommerce, CRM, multisite and web service integrations.&nbsp; <br /><br />Once you get your Drupal site installed and up and running, you will be concerned with site performance and how fast you can make your Drupal site run.&nbsp; This book will focus on implementing performance modules and solutions to help speed up your Drupal website.<br /><br />We will look at introductory topics such as upgrading your Drupal site, maintaining your site, and enabling core Drupal page compression and caching. <br />&nbsp;<br />Then we will turn to an advanced look at some contributed modules that help speed up performance, including Development, Boost, Authcache, Advanced Cache, and the Memcache API and Integration module.<br /><br />Finally, we&rsquo;ll look at how best to implement a Drupal multisite environment and run it with high-speed performance in mind.<br /><br />This book is designed for Drupal developers and webmasters who want to increase their Drupal site&rsquo;s speed and performance.&nbsp; You will take your Drupal site to the next level by not only displaying relevant and newsworthy content, but also running a powerful and high-speed website.</p>
Table of Contents (14 chapters)
Drupal 6 Performance Tips
Credits
About the Authors
About the Reviewers
Preface

Preface

The Drupal content management framework allows us to get a website up and running quickly, and proves that a multi-layer website and application environment doesn't need to be complex to set up and configure. The next step after we get our site installed, themed, and populated with content, is to monitor our site's performance. We, as users of the site and developers of the site's architecture and backend, want our site to run smoothly and quickly. We want our page loads to be super quick and our backend administration to run lightning fast. How do we optimize our large Drupal-powered, database-driven, content-heavy website with performance and speed in mind? This book will show you the steps to enable the performance 'boost' on your Drupal site.

We will discuss all aspects of Drupal performance from simple optimization and site maintenance to the larger and more complex issues of anonymous and authenticated site caching. We'll look at some basic core Drupal modules that help to govern and control performance on our site, and also look in detail at more advanced contributed module options, such as the Development, Boost, Authcache, Advanced Cache, and Cache Router modules.

With speed in mind, both for our anonymous site visitors and our logged in users, we're going to take a close look at how to optimize our Drupal site for higher performance. This book is an introduction to this complex and large subject, and we hope that it serves as a stepping stone for both novice and advanced Drupal users and developers.

What this book covers

Chapter 1, Upgrading Drupal, focuses on preparing a Drupal environment for running a high performance Drupal website. We will discuss upgrading Drupal 5.x to Drupal 6.x, creating backups of our site files and databases, running the Drupal Status report, upgrading contributed modules to their latest 6.x versions, and running update.php. We will also tweak our PHP settings using the Drupal settings.php file.

Chapter 2, Maintaining your Drupal Site, covers the basics of maintaining your Drupal website including inspecting your Drupal configuration file, checking your MySQL and PHP configurations, enabling and using the Drupal Update Status module, disabling and uninstalling contributed modules, and clearing the Drupal performance cache and theme registry. We'll also look at running cron jobs, tweaking our php.ini file, and tweaking our .htaccess file.

Chapter 3, Using Development Modules and Tools, focuses on using Drupal development modules and tools such as the Development module. We will look in detail at the Development module's functionality and use it to monitor performance on our site.

Chapter 4, Performance Optimization, focuses on Drupal performance optimization, including throttling modules and blocks through the Development module to generate dummy taxonomy, and content for our site using Views 2.x, and clearing our Views cache.

Chapter 5, Using DB Maintenance and Boost, focuses on using the DB Maintenance and the Boost modules. We'll look in detail at a basic configuration of the Boost module to enhance performance for our anonymous site users.

Chapter 6, Advanced Boost, focuses on using the Boost module to do advanced performance functionality. We'll look at using the Boost module along with Global Redirect and Transliteration, configuring advanced Boost module caching, configuring Boost crawler, and how to check and tweak our Boost .htaccess settings.

Chapter 7, Using Memcache API and Integration, focuses on using the Memcache API and Integration module. We will install a development WAMP environment using MoWeS Portable in this chapter as well as install the Memcached binary libraries, integrate and configure Memcached to work with PHP, and test the module on our development site.

Chapter 8, Advanced Caching and Contributed Modules for Caching, focuses on Advanced Drupal caching and using contributed modules for caching on our site. We will discuss using the Cache Router, Authcache, and Advanced Cache modules.

Chapter 9, Multisite Configuration and Performance, focuses on Drupal multisite configuration and performance. We will create multisite folders and configure our Drupal settings.php for multisite. We will tweak our httpd.conf file to support multisite, and use caching in a multisite environment.

What you need for this book

To follow along with the examples in this book, you will need a computer which can run MySQL, PHP, and the Apache web server, which are all prerequisites for Drupal. Luckily, every major operating system can run these applications. You may want to create an account with a website hosting company to test your work although you can also use a regular desktop or a laptop computer.

You will also need the Drupal Content Management framework, which is available from drupal.org. We will discuss downloading and installing Drupal in Chapter 1.

Who this book is for

This book is for Drupal website users and developers who want to boost and tweak performance on their website using Drupal's core and contributed performance module functionality.

You are expected to know about the basic operation of Drupal, be familiar with the concept of site configuration, and know how core and contributed modules are installed and work in Drupal. No experience with programming Drupal is required. The author will teach you how to implement specific code and patches that work with specific performance modules. Almost everything in the book will be focused on the module visual interface, and how to use this interface to configure and implement the performance module.

This book also covers upgrading Drupal, running Drupal security patches, creating backups of your Drupal site, and other basic Drupal site maintenance that will be helpful to the novice Drupal user and developer. Modules are covered in both their basic and advanced configurations; so both novice and advanced developer will learn how best to implement performance practices on their Drupal site with this step-by-step guide.

Performance is a large discussion within, and presents a large terrain to cover throughout, the Drupal community, but this book does not claim to cover every performance and site optimization issue. The authors have done their best to cover the majority of performance-based tips and tricks to run your Drupal site. They hope that the book will enhance the discussion of Drupal performance, and pave the way for more books and tutorials to be released on Drupal performance topics.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "Update the $conf in your settings.php file."

A block of code is set as follows:

<?php $conf = array( // The path to wherever memcache.inc is. The easiest is to simply point it // to the copy in your module's directory. // 'cache_inc' => './sites/all/modules/memcache/memcache.inc', // or 'cache_inc' => './sites/all/modules/memcache/memcache.db.inc', ); ?>

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes, for example, appear in our text like this: "Once enabled, you can browse to this module's admin interface by going to Reports | Memcache status via your administrative menu."

Note

Warnings or important notes appear in a box like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an e-mail to , making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/5845_CODE.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata are added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide the location address or website name immediately so we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.