nginx1.24.0编译安装 Google perftools
时间: 2023-08-05 13:10:01 浏览: 121
好的,以下是编译安装 Google perftools 的步骤:
1. 下载 Google perftools
打开 https://github.com/gperftools/gperftools/releases 页面,找到最新版本的 Google perftools 的源码压缩包,复制其下载链接。然后在终端中使用 wget 命令下载压缩包:
```
wget https://github.com/gperftools/gperftools/releases/download/gperftools-2.9.1/gperftools-2.9.1.tar.gz
```
2. 解压源码压缩包
使用 tar 命令解压刚才下载的压缩包:
```
tar -zxvf gperftools-2.9.1.tar.gz
```
3. 编译安装
进入解压后的目录,执行以下命令编译和安装:
```
cd gperftools-2.9.1
./configure
make
sudo make install
```
4. 配置 nginx
打开 nginx 的配置文件,添加以下配置:
```
google_perftools_profiles /tmp;
location /profilers {
perftools_profiles;
}
```
其中,`/tmp` 是存放 profiling 数据的目录,`/profilers` 是 profiling 的访问入口。
5. 重启 nginx
执行以下命令重启 nginx:
```
sudo service nginx restart
```
完成以上步骤后,就可以使用 Google perftools 进行 profiling 了。
阅读全文
相关推荐

















