# ngx\_google\_perftools\_module

* [示例配置](/nginx-docs/he-xin-gong-neng/qi-ta/ngx_google_perftools_module.md#example_configuration)
* [指令](/nginx-docs/he-xin-gong-neng/qi-ta/ngx_google_perftools_module.md#directives)
  * [google\_perftools\_profiles](/nginx-docs/he-xin-gong-neng/qi-ta/ngx_google_perftools_module.md#google_perftools_profiles)

`ngx_google_perftoos_module` 模块（0.6.29）可以使用 [Google 性能工具](https://github.com/gperftools/gperftools) 对 nginx 的 worker 进程进行分析。该模块适用于 nginx 开发人员。

默认情况下不构建此模块，您可以在构建时使用 `--with-google_perftools_module` 配置参数启用此模块。

> 该模块需要 [gperftools](https://github.com/gperftools/gperftools) 库。

## 示例配置 <a href="#example_configuration" id="example_configuration"></a>

```
google_perftools_profiles /path/to/profile;
```

profile 文件将被存储为 `/path/to/profile.<worker_pid>`。

## 指令 <a href="#directives" id="directives"></a>

### google\_perftools\_profiles

|       - | 说明                                          |
| ------: | ------------------------------------------- |
|  **语法** | **google\_perftools\_profiles** `file ...`; |
|  **默认** | ——                                          |
| **上下文** | main                                        |

设置保存 nginx worker 进程分析信息的文件的名名。worker 进程的 ID 始终是文件名的一部分，并追加在文件名的末尾。

## 原文档

<http://nginx.org/en/docs/ngx_google_perftools_module.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docshome.gitbook.io/nginx-docs/he-xin-gong-neng/qi-ta/ngx_google_perftools_module.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
