Welcome! Log In Create A New Profile

Advanced

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

Roman Vasilyev
February 10, 2011 05:44PM
On 02/10/2011 02:38 PM, Roman Vasilyev wrote:
> I've updated on one of my production servers mod-lua to 0.1.5, and
> nginx memory still growing.
> My config is still the same
> location / {
> include forward_proxy.conf;
>
> location = /check-spam {
> internal;
>
> include spam_fastcgi.conf;
> }
>
> 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("/terms-of-use.html")
> end';
> }
>
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"
> 2011/02/10 12:36:07 [alert] 3085#0: *21749071 sendfile() failed (9:
> Bad file descriptor) while sending request to upstream, client:
> 10.1.16.17, server: hss, request: "POST /xxx/xxx.aspx HTTP/1.1",
> upstream: "http://x.x.x.x/xxx/xxx.aspx", host: "xxx.com"
>
> On 02/10/2011 02:36 AM, agentzh wrote:
>> On Thu, Feb 10, 2011 at 6:26 PM, Alexander Kunz<akunz@ntmedia.de>
>> wrote:
>>> Thanks for sharing so many of your Nginx addons, Nginx scripting is so
>>> exciting. I read
>>> your 2 slides about Nginx scripting. Very intersting, are there some
>>> more
>>> examples or informations
>>> about Nginx scripting?
>>>
>> Maybe my blog count? ;)
>>
>> http://agentzh.blogspot.com/
>>
>> I do have the plan of writing a bunch of (detailed) tutorials on this
>> this year.
>>
>>> I try out your example, you subrequest on a redis location. I use
>>> the redis2
>>> addon, but i
>>> allways get in the first line the bytes for my redis request. Is
>>> there a
>>> solution hide this information?
>> The ngx_redis2 module returns the raw TCP response from the redis
>> server. It's recommended to use my lua-redis-parser module (written in
>> pure C) to parse these responses into lua data structure:
>>
>> https://github.com/agentzh/lua-redis-parser
>>
>> If you only want to use the "get" redis command, you can try out the
>> ngx_redis module here:
>>
>> http://wiki.nginx.org/HttpRedis
>>
>> It returns the parsed content part of the redis response because only
>> "get" is needed to implement.
>>
>>> So it would be possible to use redis2 for caching whole HTML pages.
>>>
>> Right, using ngx_srcache + ngx_lua + lua-redis-parser. See ngx_srcache
>> for details:
>>
>> http://github.com/agentzh/srcache-nginx-module
>>
>> It's much like Apache2's mod_cache, but only support silly response
>> body caching (for now) and is 100% non-blocking. I're already using
>> ngx_srcache + ngx_memc to cache responses via memcached in production.
>>
>>> Have a nice day agentzh!
>>>
>> Thanks! :) The same to you ;)
>>
>> Cheers,
>> -agentzh
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

agentzh February 09, 2011 05:08AM

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

agentzh February 10, 2011 12:34AM

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

Eugaia February 10, 2011 04:08AM

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

Alexander Kunz February 10, 2011 05:28AM

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

agentzh February 10, 2011 05:38AM

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

Roman Vasilyev February 10, 2011 05:42PM

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

Roman Vasilyev February 10, 2011 05:44PM

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

kindy February 10, 2011 09:06PM

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

agentzh February 11, 2011 12:06AM

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

Roman Vasilyev February 11, 2011 03:00PM

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

agentzh August 09, 2011 12:04AM

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

agentzh August 09, 2011 12:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 154
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready