Welcome! Log In Create A New Profile

Advanced

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

November 27, 2011 04:14PM
Consider the case where nginx is used as a reverse proxy, and upstream is doing some server push (the http request never ends).
You are saying that timeouts/keepalive should be used. I would agree with you, and I actually made a module for nginx+tcp_keepalive: https://github.com/nviennot/nginx-tcp-keepalive

But that's not enough. The closed SSL connection stays open from nginx point of view, even though it doesn't appear anymore in netstat.
On the other hand, when upstream sends something, nginx write() to the closed socket will fail with EPIPE.
Maybe you were referring using keepalive by having upstream periodically sending data to the client.
But that's adding a requirement on the upstream logic, which is why it's not just an optimization problem, but an actual bug, when upstream rely on nginx to close the connection when the client does to detect its presence.

Bottom line: I'll send a patch with EPOLLRDHUP. Also feel free to comment on the tcp-keepalive module.
Subject Author Posted

Is there a bug in ngx_http_upstream_module's broken connection check code?

speedfirst June 23, 2011 12:14AM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

Maxim Dounin June 23, 2011 08:14AM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

speedfirst June 23, 2011 10:24PM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

nviennot November 26, 2011 07:41AM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

Maxim Dounin June 23, 2011 10:28PM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

Maxim Dounin November 26, 2011 06:40PM

Re: Is there a bug in ngx_http_upstream_module's broken connection check code?

nviennot November 27, 2011 04:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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