(Tips) An Introduction to Drupal & MySQL Performance Tuning Part I

Tips : An Introduction to Drupal & MySQL Performance Tuning Part I

Introduction

Improving Drupal's MySQL performance is more than just optimizing Drupal and MySQL themselves. I wanted to mention that the server hardware, operating system, webserver, and PHP also play important roles in deploying the fastest system possible. Benchmarking and profiling a system is a very methodical step-by-step process starting from the hardware, the operating system, Apache, PHP, MySQL then finally Drupal itself.

Server Hardware

Everything starts at the hardware level and having a way to benchmark CPU, memory, and harddrives is very important. Not all motherboards are created equal either. If at all possible, developing a benchmarking plan to test different CPUs, memory and harddrives will go along way to help creating a high performance Drupal/MySQL system. Using sysbench from http://sysbench.sourceforge.net/, it's possible to show which CPU, memory and harddrive combinations that will provide the best performance at the hardware level. Armed with this information, the correct hardware can be purchased. Even if a client already has a Drupal site in production, knowing this benchmark information can help in pointing out which areas should be investigated.

Scaling up versus scaling out. Scaling up is the process of building single bigger servers for a given Drupal/MySQL installation. Scaling out is the process of spreading the webserver and/or Drupal/MySQL stack across several servers.

OS Tuning

Since kernel 2.6.x, the Linux kernel does a very good job with automatic tuning. On a few systems, I've increased the size of the network buffers I realized an improvement to warrant the effort in benchmarking, making the configuration changes, and documentation. If the system requires NFS, that also needs to be investigated via a thorough benchmarking plan geared towards that end.

Webserver

Some general Apache parameters like SendBufferSize can be increased up to the largest HTML page size, up to the kernel network write limit. Another approach is to split different media across different servers, video on one, images on another, audio on yet another webserver based upon site useage statistics. A caching front end to the webserver stack could also be beneficial. The effort to investigate memcached may be worth the effort too. There are many ways to approach this problem, each with pros and cons.

| Read more..

Courtesy : Marksitblog.blogspot.com