atom feed17 messages in ru.sysoev.nginxHigh memory consumption when proxying...
FromSent OnAttachments
Rogério SchneiderApr 11, 2010 5:16 pm 
Maxim DouninApr 11, 2010 5:48 pm 
Rogério SchneiderApr 11, 2010 6:07 pm 
Maxim DouninApr 11, 2010 6:56 pm 
Rogério SchneiderApr 11, 2010 8:42 pm 
Maxim DouninApr 12, 2010 12:51 pm 
Rogério SchneiderApr 12, 2010 1:16 pm 
Maxim DouninApr 12, 2010 2:26 pm 
Rogério SchneiderApr 15, 2010 12:42 am 
zanetteaMay 28, 2010 6:54 am 
Rogério SchneiderJun 7, 2010 7:14 pm 
Maxim DouninJun 8, 2010 1:34 am 
zanetteaJun 8, 2010 4:45 am 
Rogério SchneiderJun 8, 2010 7:45 am 
Rogério SchneiderJun 8, 2010 7:54 am 
Igor SysoevJun 8, 2010 8:05 am 
Rogério SchneiderJun 8, 2010 4:57 pm 
Subject:High memory consumption when proxying to a Comet server
From:Rogério Schneider (stoc@gmail.com)
Date:Apr 11, 2010 5:16:10 pm
List:ru.sysoev.nginx

Folks,

When proxying to a Comet server, I was able to notice that Nginx is eating and not releasing a massive amount of memory.

As we all know, Comet servers can have this "streaming" mode, where we receive a chunked HTTP request that never ends.

Is there some problem that avoids Nginx to release memory when in proxy mode, before the connection ends at all?

I am using Nginx to balance between some instances of the Comet server: upstream comet { server comet:8081; server comet:8082; ... }

Memory consumption for Nginx procs for each minute during the tests: 271.3 MiB + 368.0 KiB = 271.6 MiB nginx (9) 273.3 MiB + 368.0 KiB = 273.6 MiB nginx (9) 274.8 MiB + 368.0 KiB = 275.2 MiB nginx (9) 276.6 MiB + 368.0 KiB = 277.0 MiB nginx (9) 278.8 MiB + 368.0 KiB = 279.2 MiB nginx (9) 281.0 MiB + 368.0 KiB = 281.4 MiB nginx (9) 283.2 MiB + 368.0 KiB = 283.6 MiB nginx (9) 285.4 MiB + 368.0 KiB = 285.8 MiB nginx (9) 287.2 MiB + 368.0 KiB = 287.6 MiB nginx (9) 288.9 MiB + 368.0 KiB = 289.3 MiB nginx (9)

I could also notice that the bigger is the message I send through the Comet server (thus, through Nginx too) the bigger is the memory allocation in the Nginx procs. Also, if this helps, Nginx only writes down the access_log when the client closes the connection.

What could I do to avoid this "leak" behaviour for long lasting proxy connections in Nginx?

Regards,

http://stockrt.github.com