Welcome! Log In Create A New Profile

Advanced

Re: HttpLuaModule create asynchronous subrequests

Yichun Zhang (agentzh)
November 13, 2014 03:26PM
Hello!

On Wed, Nov 12, 2014 at 12:20 PM, Guido Accardo wrote:
>
> Here, prod response is sent immediately as I want and dev receives the
> traffic but the connection is closed the I got a Broken Pipe (which makes
> sense).
>

For this error, maybe you should configure

proxy_ignore_client_abort on;

for your dev location with proxy_pass.

But using ngx.eof() for this will still introduce extra delay for the
subsequent requests on the current downstream connection when HTTP
keepalive or HTTP pipelining is enabled.

>
> Is there a way to do capture calls in a asynchronous mode or to achieve this
> in other way?
>

The recommended way is to use cosocket-based http library like Brian
Akins's lua-resty-http-simple [1] (instead of subrequests and
ngx_proxy) in a 0-delay timer created by ngx.timer.at() [2] (instead
of the ngx.eof hack).

BTW, it's recommended to join the openresty-en mailing list [3] for
such ngx_lua related questions that way you may get more responses and
get responses sooner.

For your very use case, maybe lower level tools like tcpcopy [4] is a
better fit? Not sure though :)

Regards,
-agentzh

[1] https://github.com/bakins/lua-resty-http-simple
[2] https://github.com/openresty/lua-nginx-module#ngxtimerat
[3] https://groups.google.com/group/openresty-en
[4] https://github.com/session-replay-tools/tcpcopy

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

HttpLuaModule create asynchronous subrequests

Guido Accardo November 12, 2014 03:22PM

Re: HttpLuaModule create asynchronous subrequests

Yichun Zhang (agentzh) November 13, 2014 03:26PM

Re: HttpLuaModule create asynchronous subrequests

Guido Accardo November 14, 2014 02:22PM

Re: HttpLuaModule create asynchronous subrequests

Yichun Zhang (agentzh) November 14, 2014 04:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
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