ngx_google_perftools_profiler_module
202 次浏览
更新于 2020-11-01 17:43

授权协议:BSD 3-Clause "New" or "Revised" license
原作者联系方式:chrono_cpp@me.com
功能说明:nginx 性能分析模块
  • 内容介绍

ngx_google_perftools_profiler_module

A better tool for nginx with google_perftools.

This module is inspired by official ngx_google_perftools_module.

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..

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


发表评论
  • 阿尔巴

    哇,感谢分享

    2020-11-20 10:11
    0
    回复
提交者

皮皮鲁

老白菜

  • 21

    文章

  • 19

    关注

  • 19

    粉丝

版权所有©F5 Networks,Inc.保留所有权利。京ICP备16013763号-5