我要评分
获取效率
正确性
完整性
易理解

Tuning malloc

Purpose

The test result shows that the malloc hotspot is high. TCMalloc is more suitable for the current scenario than glibc malloc.

Procedure

  1. Install the gperftools-libs package.
    1
    yum install gperftools-libs
    
  2. Configure LD_PRELOAD before starting Nginx.
    export LD_PRELOAD=/usr/lib64/libtcmalloc.so.4