<!-- review: finished -->

<a id="google-perftools"></a>

# Google PerfTools Module

Enables profiling of Angie worker processes using [Google
Performance Tools](https://github.com/gperftools/gperftools). The module is
intended for Angie developers and allows them to analyze and optimize server
performance by providing detailed information about memory usage, CPU load, and
other performance metrics.

When [building from source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild),
this module isn't built by default;
it should be enabled with the
`--with-google_perftools_module`
[build parameter](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure).

#### NOTE
This module requires the
[gperftools](https://github.com/gperftools/gperftools) library.

<a id="configuration-example-2"></a>

## Configuration Example

```nginx
google_perftools_profiles /var/log/angie/perftools;
```

Profiles will be stored in files like
`/var/log/angie/perftools.<worker process PID>`.

<a id="directives-2"></a>

## Directives

<a id="index-0"></a>

<a id="google-perftools-profiles"></a>

### google_perftools_profiles

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `google_perftools_profiles` file prefix;   |
|------------------------------------------------------------------------------------------|--------------------------------------------|
| Default                                                                                  | —                                          |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | main                                       |

Sets the filename prefix
where profiling information for the Angie worker process will be stored.
The worker process ID is appended at the end of the filename after a dot, for example:
`/var/log/angie/perftools.1234`.
