Categories
MySQL

Google Perftools 1.4 are available for Debian 5.0 “Lenny”

Looking for a new way to speed up your MySQL server? The tcmalloc library from Google Perftools could be the answer (about 15-20% performance improvement). Refer to this (updated) How-to for more information.

I just packaged Google Perftools 1.4 for Debian 5.0 (a.k.a. “Lenny”). According to the Changelog, they’re bringing a lot of bugfixes and improvements, and then they enhance the stability of the daemons they’re plugged in, especially on 64bits systems.

Upgrading from previous version is highly recommended.

Categories
MySQL

Google Perftools 1.3 available for Lenny

Do you remember how to speed up your MySQL server using the Google Perftools? It seems that the amd64 flavour of these libraries makes MySQL crash.

I just bumped the version of the google-perftools packages for Lenny from 1.0 to 1.3. According to the Changelog they’re bringing a lot of bugfixes and improvements, and then enhance the stability of the daemons they’re plugged in.

Upgrading is highly recommended.

Update : The packages are now available for Etch.

Update #2 : Please desactivate the Google Perftools 1.3! They’re crashing MySQL. I’m rolling back to the old version (Etch : 0.98, Lenny : 1.0) until I fix (or Google) fix this issue. Really sorry for the mess…

Categories
Documentation MySQL

Using the Google Perftools to speed up your MySQL server

The Google Perftools, especially tcmalloc (Thread Caching Malloc), can be very useful to speed up your applications, depending on your environment :

TCMalloc is faster than the glibc 2.3 malloc (available as a separate library called ptmalloc2) and other mallocs that I have tested. ptmalloc2 takes approximately 300 nanoseconds to execute a malloc/free pair on a 2.8 GHz P4 (for small objects). The TCMalloc implementation takes approximately 50 nanoseconds for the same operation pair.

Its deployment in your LAMP stack can speed up your MySQL servers, since it enhances memory allocation on threaded applications with the downside of larger memory footprints.

Here is how to use it easily…

Installation

First of all, be sure you use Debian 5.0 (a.k.a. “Lenny”) or later. Then install the minimal tcmalloc library from Dotdeb :

apt-get install libtcmalloc-minimal0

Then, since the mainstream MySQL packages are not compiled against tcmalloc, you’ll have to trick your OS’ dynamic linker by adding the following line at the top of your /etc/init.d/mysql init script :

export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.0"

/etc/init.d/mysql modification

After relauching your MySQL server using the modified init script, you’ll take profit from tcmalloc’s faster memory allocation.

Results

At the time of writing this article, I didn’t make benchmarks, but some reported that they had a ~15-20% performance gain. Please leave comments about your experience.