利用 TCMalloc 优化 Nginx 的性能

TCMalloc 全称为 Thread-Caching Malloc,是谷歌的开源工具 google-perftools 的成员,它可以 在内存分配效率和速度上高很多,可以很大程度提高服务器在高并发情况下的性能。从而降低系统 的负载。

1.   安装 libunwind 库,libunwind-0.99-alpha.tar.gz tar zxvf libunwind-0.99-alpha.tar.gz

cd libunwind-0.99-alpha

CFLAGS=-fPIC ./configure

make CFLAGS=-fPIC &&     make CFLAGS=-fPIC   install

2.   安装 google-perftools

tar zxvf gperftools-2.1.tar.gz cd gperftools-2.1

扫描二维码关注公众号,回复: 6990778 查看本文章

./configure

make && make install

echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf ldconfig

至此,google-perftools 安装完成

猜你喜欢

转载自www.cnblogs.com/fanweisheng/p/11328419.html