内存泄露求助,有内存泄露火焰图

355 views
Skip to first unread message

Vurt

unread,
Nov 1, 2016, 10:30:37 PM11/1/16
to openresty


hi,我们基于openresty实现了一个动态的反向代理,使用了一个第三方模块https://github.com/yzprofile/ngx_http_dyups_module 。上线后发现内存会一直增长,在公司内网使用,压力不大,但是跑个3、4天服务器会挂掉。机器配置:系统centos7,内存16G

尝试定位了一下,并没有找到原因:

1. stapxx lj-gc.sxx结果:

Total GC Count:410290 bytes,nginx进程内存占用很高时结果也差不多,估计问题不是出在Lua VM中

2. 用samplt-bt-leaks.sxx采集30秒(时间太长会出错:ERROR: Array overflow,MAXMAPENTRIES设置为50000),有时采集完会报 free misses的警告,下面是两次采样生成的火焰图,我对火焰图不是很了解,希望章老师帮忙看看,谢谢。svg在附件中





6-fm2.svg
5-fm26.svg

Vurt

unread,
Nov 1, 2016, 10:41:09 PM11/1/16
to openresty
实现方式 :
 location / {
           set $real_upstream "placeholder";
           set $real_uri "";
           
           
# 这里计算real_upstream
           access_by_lua_file lib/gatekeeper/main.lua;

           proxy_pass http://$real_upstream$real_uri;
       }


DeJiang Zhu

unread,
Nov 2, 2016, 10:05:13 PM11/2/16
to open...@googlegroups.com
Hello

从你提供的图来看,貌似并不能确认泄露点

内存泄露火焰图,我有这么一种使用方式:

1. 先来一张采样时间短的图,比如 30s
2. 再来一张采样时间长的图,比如 100s

这样对比看那些点很明显变宽了,那就是嫌疑点了

最好多几次采样对比,这样更靠谱 :)


--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

Reply all
Reply to author
Forward
0 new messages