---
title: "Google Perf tools - Debian, TCMalloc, Magento and Percona MySQL"
date: "2013-02-28"
modified: "2013-03-04"
path: "/89-google-perf-tools-tcmalloc-magento-percona-mysql.html"
section: "/ramblings"
aliases:
  - "/89"
  - "/89-google-perf-tools-tcmalloc-magento-percona-mysql"
  - "/89.html"
  - "/ramblings/89-google-perf-tools-tcmalloc-magento-percona-mysql.html"
---

For several years now we've been running complex Magento-based stores and on the client's that are very busy we've noticed some issues with MySQL locking when it shouldn't really need to.

After some searching around I came across the [GitHub blog post](https://github.com/blog/1422-tcmalloc-and-mysql) that describes exactly what we found on our system. Here are the details in order to make this function on your Debian 6 installation (and in this case with Percona MySQL):

```
apt-get install libtcmalloc-minimal0
nano /etc/init.d/mysql
```

add just after export HOME

```
export LD_PRELOAD="/usr/lib/libtcmalloc_minimal.so.0"
/etc/init.d/mysql restart
```
