Skip to content

chronolaw/ngx_google_perftools_profiler_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngx_google_perftools_profiler_module

A better tool for nginx with google_perftools.

This module is inspired by official ngx_google_perftools_module.

Build Status

Installation

At first you must install gperftools library, For example:

sudo apt-get install google-perftools
sudo apt-get install libgoogle-perftools-dev

Then configure nginx, add this module:

./configure --add-module=path/to/ngx_google_perftools_profiler_module
make && make install

Configuration

In nginx.conf:

# profiler => cpu|heap|all
# name => file that keeps profiling information
# interval => time interval for dump heap profiling information, in seconds
google_perftools profiler=all name=ngx_prof interval=1s;

Profiles will be stored as /path/to/file.<worker_pid>.

Then you can use pprof to visualize results, for example:

pprof --svg /usr/local/nginx/sbin/nginx ./ngx_prof.4342 >a.svg
pprof --svg /usr/local/nginx/sbin/nginx ./ngx_prof.4342.0007.heap >b.svg

The svg samples can find in svg directory.

Lua API

You can use the Lua API binding lua-resty-gperftools for more flexible control.

See Also

About

a better tools for nginx with google_perftools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages