First let me show my understanding of ngnix working till now...
In my ngnix.conf - inside php-fastcgi handler block I have settings...
[code]fastcgi_buffers 64 4k;[/code]
i.e. 256K buffer size (I am on 32-bit platform). This means that if php scripts generate more than 256K size responses nginx will read first 256K sends it to a client and empties the buffer's contents. If there's more responce data - it reads & sends again.
At this point when ngnix performs multiple reads does it writes to the error_log a [warn] line like an "upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/"
Is this something to worry about?
As ngnix uses a function like below to allocate memory while sending PHP script response to client
[code] min(buffer_size,response_size)[/code]
If site often provides small script-generated response, large buffer_size will waste a lot of memory.
But using large fastcgi_buffers removed warning "upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/" from error_logs.
I really lots of free RAM but I wanted to allocated buffers in most optimized way and use rest of my free RAM to start more php-cgi child processes (I think it will help me handle more traffic bursts)
Any inputs on this greatly appreciated.
Thanks,
-Rahul
--
Rahul Bansal
EasyEngine - https://github.com/rtCamp/easyengine