数据库内存管理:tcmalloc与jemalloc

 

[root@wallet01 ~]# tar zxvf libunwind-1.2.1.tar.gz 
[root@wallet01 ~]# cd libunwind-1.2.1
[root@wallet01 libunwind-1.2.1]# ./configure
[root@wallet01 libunwind-1.2.1]# make && make install

[root@wallet01 ~]# tar zxvf gperftools-2.7.tar.gz
[root@wallet01 ~]# cd gperftools-2.7
[root@wallet01 google-perftools-2.7]# ./configure
[root@wallet01 google-perftools-2.7]# make && make install

[root@wallet01 ~]# vi /usr/local/mysql/bin/mysqld_safe
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so

[root@wallet01 ~]# echo "/usr/local/lib" >> /etc/ld.so.conf
[root@wallet01 ~]# ldconfig

[root@wallet01 ~]# service mysqld restart
Shutting down MySQL..                                      [  OK  ]
Starting MySQL.. 
                                          [  OK  ]
[root@wallet01 ~]# lsof -n | grep tcmalloc
mysqld    30576     mysql  mem       REG                8,3    2312499              4092713 /usr/local/lib/libtcmalloc.so.4.5.3


猜你喜欢

转载自blog.51cto.com/13598811/2338266