The last few “Tech Support” columns have shown how to improve the performance of your PHP applications. You can now speed up PHP performance with memcached and APC, configure and compile PHP to fine-tune it for your application and system, and load balance among several servers with Perlbal.
PHP, however, is only one part of the stack. This month, let’s look at how to tweak MySQL. Since MySQL optimization is a significant topic and often specific to your application, let’s instead focus on obtaining some quick results that can lead to more in-depth investigation and customization.
First, you should also deploy MySQL on the right hardware. MySQL is memory hungry, so install as much RAM as you can afford. Once installed, tune MySQL to use memory for its various buffers. Fast disks and sufficient CPU are next, respectively.
Next, the official MySQL binaries, unlike many applications, come extremely well-tuned. If you’re not an expert user, you are almost certainly better off using the packages pre-built for your platform.
On the topic of packages, many distributions ship with MySQL pre-installed. This is convenient, but may not allow you to stay current with the latest stable version of MySQL. You’ll need to make a decision on whether it’s best for your organization to forgo distribution support for MySQL (say, if you’re using an enterprise distribution) and benefit from the enhancements and bug fixes provided by MySQL AB. If you’re not using a distribution that comes with…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: