[ANN] ngx_lua v0.1.5: ability to capture multiple parallel subrequests

Roman Vasilyev roman at anchorfree.com
Fri Feb 11 22:56:34 MSK 2011


About memory leak wont to apologize, my fault,.
Actually ngix memory usage increased but stable, and Valgrind not 
showing any memory leaks.
location = /t-get-lua-mem-use {
content_by_lua '
ngx.say("lua use " .. collectgarbage("count") .. "KB")
';
}

Garbagecollector shows:
this shows range 40~100Kb.
Problem in perl script which realizing FCGI for spamassasin, we'll fix it.
Problem in log still exists:

On 02/10/2011 09:01 PM, agentzh wrote:
> On Fri, Feb 11, 2011 at 6:41 AM, Roman Vasilyev<roman at anchorfree.com>  wrote:
>    
>> Forgot to say that below is my error log with 2 very frequent messages:
>>      
>>> 2011/02/10 12:36:00 [alert] 3090#0: *21747555 zero size buf in output t:1
>>> r:0 f:0 0000000006D42970 0000000006D42970-0000000006D42970 0000000000000000
>>> 0-0 while sending request to upstream, client: 10.1.24.20, server: hss,
>>> request: "POST /xxx/xxx.asmx HTTP/1.1", upstream:
>>> "http://x.x.x.x/xxx/xxx.asmx", host: "xxx.com"
>>>        
even with commented out fastcgi request, so subrequest always return 404.
             location / {
                     include forward_proxy.conf;

                     location = /check-spam {
                             internal;

                             #include spam_fastcgi.conf;
                     }

                     location = /t-get-lua-mem-use {
                             content_by_lua '
                                     ngx.say("lua use " .. 
collectgarbage("count") .. "KB")
                                     ';
                     }

                     lua_need_request_body on;

                     rewrite_by_lua '
                       if ngx.var.request_method ~= "POST" then
                         return
                       end
                       local res = ngx.location.capture( "/check-spam", 
{ method = ngx.HTTP_POST, body = ngx.var.request_body })
                       local a=string.sub(res.body,0,4)=="SPAM"
                       if a then
                         return 
ngx.redirect("http://www.anchorfree.com/terms-of-use.html")
                       end';
             }
but any way everything works fine, only logs full of "zero size buf in 
output.... request: POST...."


> What are your client_max_body_size and client_body_buffer_size settings?
>
> It seems that your request body has been tainted which could happen
> when client_max_body_size>  client_body_buffer_size and the body is
> big enough buffered to a disk file.
>
> But I cannot reproduce any leaks or thse zero size buf errors on my
> side or on our production servers.
>
> It'll be great if you provide the following additional information:
>
> 1. your lua library's version (or any 3rd-party patches applied by
> your OS vendor),
>    
# rpm -qa|grep lua
lua-5.1.4-0
lua-devel-5.1.4-0

> 2. your nginx -V output (or any 3rd-party patches applied by your OS vendor),
>    
# nginx -V
nginx: nginx version: nginx/0.9.4
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
nginx: configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid 
--lock-path=/var/lock/nginx.lock --user=www --group=www 
--with-http_flv_module --with-http_gzip_static_module 
--with-http_sub_module --http-log-path=/var/log/nginx/access.log 
--http-client-body-temp-path=/var/nginx/client/ 
--http-proxy-temp-path=/var/nginx/proxy/ 
--http-fastcgi-temp-path=/var/nginx/fcgi/ --with-http_stub_status_module 
--add-module=/usr/src/redhat/SOURCES/af-headers 
--add-module=/usr/src/redhat/SOURCES/echo-module 
--add-module=/usr/src/redhat/SOURCES/ndk 
--add-module=/usr/src/redhat/SOURCES/lua-module 
--add-module=/usr/src/redhat/SOURCES/gunzip

> 3. the precise memory change curve of your nginx worker processes over time,
> 4. the Lua function call collectgarbage("count") output when you think
> your nginx is leaking,
>    
showed upper
> 5. sample requests that can easily reproduce the leak on other
> environment, like on my laptop.
>    
I'm trying to find best way how to reproduce it, now it hard to 
reproduce without load.
> Cheers,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>    




More information about the nginx mailing list