Use Google's tcmalloc to accelerate MySQL

Source: Internet
Author: User

1. download MySQL source package, compile and install (slightly)

2. Download and install Google-perftools

wget Https://lnamp-web-server.googlecode.com/files/google-perftools-1.7.tar.gzwget http://ftp.twaren.net/Unix/ Nongnu//libunwind/libunwind-0.99.tar.gz

3. - -bit systems need to install the Libunwind package

Tar zxvf libunwind-0.99.tar.gzcd libunwind-0.99cflags=-fpic./configure--enable-sharedmake CFLAGS=-fPICmake CFLAGS=- FPIC Install

4. Installing the Google-perftools package

Tar zxvf google-perftools-1.7.tar.gzcd google-perftools-1.7mkdir/work/tc./configure--PREFIX=/WORK/TC-- Disable-cpu-profiler--disable-heap-profiler--disable-heap-checker--disable-debugalloc--enable-minimalmake & & Make Install

5. Copy the dynamic link library to the system directory

Cp/work/tc/lib/libtcmalloc_minimal.so.0.1.0/usr/local/libln-s/usr/local/lib/libtcmalloc_minimal.so.0.1.0/usr/ Local/lib/libtcmalloc.soln-s/usr/local/lib/libtcmalloc_minimal.so.0.1.0/usr/local/lib/libtcmalloc.so.0ln-s/usr /local/lib/libtcmalloc_minimal.so.0.1.0/usr/local/lib/libtcmalloc.so.0.1.0

6. adjusting the Mysqld_safe configuration file

Vim/work/mysql5.5/bin/mysqld_safe

After this line of files, add the following:

# executing Mysqld_safe exportld_preload= "/usr/local/lib/libtcmalloc.so"

7. Restart MySQL

/etc/init.d/mysql restart

8. validation

[Email protected] ~]# Lsof-n | Greptcmallocmysqld 17895 mysql mem REG 253,0 962769 534587/usr/local/lib/libtcmalloc_min Imal.so.0.1.0[[email protected] ~]#



This article is from the "Sword Slave" blog, be sure to keep this source http://diudiu.blog.51cto.com/6371183/1581234

Use Google's tcmalloc to accelerate MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.