nginx和MySQL安装加载gperftools模块

gperftools是google小组
if [ `uname -i` == "x86_64" ];
then
cd /tmp
wget -c http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz 
tar zxf libunwind-1.1.tar.gz
cd libunwind-1.1
./configure
make && make install
fi
cd /tmp
wget -c https://gperftools.googlecode.com/files/gperftools-2.0.tar.gz
tar zxf gperftools-2.0.tar.gz
cd gperftools-2.0
./configure  
make  && make install 

echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
将编译好的libtcmalloc.so模块加入mysqld_safe启动的时候进行动态加载
 sed -i 's/executing mysqld_safe/executing mysqld_safe\nexport LD_PRELOAD=\/usr\/local\/lib\/libtcmalloc.so/g'    /usr/bin/mysqld_safe
/etc/init.d/mysql restart
nginx不支持动态加载所以要重新编译
./configure 【其他参数】 --with-google_perftools_module
make && make install 
echo "google_perftools_profiles /tmp/tcmalloc;">>/etc/nginx/nginx.conf
/etc/init.d/nginx restart
mkdir /tmp/tcmalloc/ 
chmod  0777 /tmp/tcmalloc/ 

nginx和MySQL安装加载gperftools模块

1 条用户评论。
  1. 评论 发表时间:Friday 11th/01/2013 08:44:35 PM 1楼

    哇,博主好博学,gperftools原来是这样安装的,学习了学习了。

添加新评论 »