一、安装libunwind-1.0.tar.gz
-
./configure
-
make
-
autoreconf -i -f
-
make install
二、安装gperftools-2.0.tar.gz
-
./configure --enable-frame-pointers
-
make
-
make install
三、MYSQL 和NGNINX 编译配置
-
./configure --prefix=/usr/local/mysql --localstatedir=/var/lib/mysql --with-charset=utf8 --enable-thread-safe-client \ --with-extra-charsets=complex --with-big-tables --with-ssl --enable-assembler --enable-local-infile --with-plugins=innobase --with-plugins=partition \--with-mysqld-ldflags=-ltcmalloc
- ./configure --with-http_stub_status_module --with-google_perftools_module
- google_perftools_profiles /tmp/tcmalloc; 在nginx 主配置 worker_rlimit_nofile 添加此行
四、查看是否加载成功
[root@localhost webinstall]# lsof -n|awk '{if($0~/tcmalloc/)print $0}'
nginx 6870 nobody 41w REG 253,0 0 937989 /tmp/tcmalloc.6870
mysqld 22530 mysql mem REG 253,0 2216045 948539 /usr/local/lib/libtcmalloc.so.4.1.0
本文转自 ibelieveme 51CTO博客,原文链接:http://blog.51cto.com/skyson/912463,如需转载请自行联系原作者