Community Documentation

Tuning Drupal on OS X Tiger

Last updated September 19, 2008. Created by LinL on September 20, 2005.
Edited by jbrauer, Amazon, killes@www.drop.org, jvandyk. Log in to edit this page.

Using the Devel module I discovered that the default mysql configuration parameters were slowing drupal down.
To see where your mysql is installed type at the command line:

which mysql

The selection of configuration files are in share/mysql; or if you followed the above instructions for installing MySQL, it should be in /usr/local/mysql/support-files.

The configuration file is in etc/mysql4; or if you followed the above instructions for installing MySQL, it should go in /usr/local/mysql but is not there by default. You can put it there by copying it in:

sudo cp /usr/local/mysql/support-files/my-large.cnf /usr/local/mysql/my.cnf

Restart MySQL for the new settings to take effect.

To view the current variable settings for MySQL, from the terminal command line client type:

mysqladmin -uroot -p variables

I opted for the "my-large.cnf" settings and halved the sql query times.

You can monitor MySQL through a pleasant user interface using MySQL Administrator, though it seems to expect my.cnf at /etc/my.cnf (it will still work, you just can't view the conf file).

I also discovered that I could roughly halve page load times by using Apache 2 instead of the stock Apache on Tiger. To see what version you are running:

httpd -v

I downloaded the php and Apache 2 from ServerLogistics: http://serverlogistics.com/downloads.php.

I am not sure I can recommend this for production sites as I do see some error diagnostics I haven't resolved yet. I didn't expect such a big difference with Apache2. Measurements with a system call profiler show that it does about half the read(2) system calls as Apache 1.3.

The overall impression I have from my benchmarking is that drupal pages require a lot of disk I/O to synthesize. Anything you can do to speed up or miminize (e.g. caching) is going to help. MySQL already has plenty of caching if a my.cnf files is being used. For the Apache/PHP part busy sites will need a php accelerator.

Additional resource:

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.