High memory consumption when proxying to a Comet server

zanettea nginx-forum at nginx.us
Tue Jun 8 15:45:52 MSD 2010

The patch I attached actually frees memory before the connection ends but do a lot of assumptions that might not work. The cleanest solution is probably just to disable chunked transfer encoding with the option: 

chunked_transfer_encoding off;

which removes the problem at the root (if it is ok for you to disable chunked transfer encoding, of if you already implement it in the proxied server).

AFAIK nginx does not support memory freeing/reuse before connection ends and, with current architecture, is not a trivial job to do (requires to handle reuse of non-contiguous allocations).

Arrigo Zanette

Rogério Schneider Wrote:
> On Fri, May 28, 2010 at 10:54 AM, zanettea  wrote:
> > I have the very same problem trying to proxying
> a MJPEG stream. I really would appreciate a
> solution not involving periodically resetting the
> connection.
> I have seen your post referring mine, here
> http://forum.nginx.org/read.php?29,91967,92454 and
> also have seen this
> another post related to the matter here
> http://forum.nginx.org/read.php?2,84623,84623#msg-
> 84623 but no one
> seems to bother in giving a direct response if
> that is or isn't
> possible to free memory for chunked responses
> BEFORE the connection
> ends.
> Regards,
> -- 
> Rogério Schneider
> http://stockrt.github.com
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,73923,95800#msg-95800

More information about the nginx mailing list