点赞
评论
收藏
分享
举报
ngx_google_perftools_profiler_module
发表于2020-10-10 23:45

浏览 1.7k

文章标签

授权协议:
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


已修改于2023-03-09 01:40
创作不易,留下一份鼓励
皮皮鲁

暂无个人介绍

关注



写下您的评论
发表评论
全部评论(0)

按点赞数排序

按时间排序

关于作者
皮皮鲁
这家伙很懒还未留下介绍~
85
文章
2
问答
42
粉丝
相关文章