Mac OS X Server: Improving MySQL Performance

On versions before 10.4.7, the default configuration of MySQL on Mac OS X Server reduced the memory footprint of the database service at the cost of server performance. With version 10.4.7 and later, MySQL on Mac OS X Server creates a my.cnf file from an included configuration file which significantly increases performance at the cost of increased memory usage. (Note: an existing version of the my.cnf file will not be destroyed by the upgrade, but it will not be upgraded either.)

For sites running older versions of Mac OS X Server, MySQL performance may be increased by following the steps below, according to the amount of RAM in the server.

To improve MySQL performance, follow the steps below, according to the amount of RAM in the server.

Systems with up to 1 GB of RAM

  1. Run this command:
    sudo cp /usr/share/mysql/my-large.cnf /etc/my.cnf

  2. Open the the configuration file in your preferred text editor. In the file locate the section labeled [mysqld]. Add the following at the end of section:
       skip-thread-priority

  3. Start (or restart) MySQL.

Systems with more than 1 GB of RAM

  1. Run this command:
    sudo cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

  2. Open the the configuration file in your preferred text editor. In the file locate the section labeled [mysqld]. Add the following at the end of section:
       skip-thread-priority

  3. Start (or restart) MySQL.

For sites with an existing my.cnf file, Apple recommends the administrator compare their current settings with those documented in one of the above existing sample configuration files and update as necessary.

Published Date: Feb 19, 2012