Turning off disk buffering?

Igor Sysoev is at rambler-co.ru
Thu Oct 18 23:15:24 MSD 2007


On Thu, Oct 18, 2007 at 06:47:59PM +0200, Brice Figureau wrote:

> 
> On Thu, October 18, 2007 17:50, Athan Dimoy wrote:
> > "Igor Sysoev" <is at rambler-co.ru> wrote in message
> > news:20071018153149.GP88820 at rambler-co.ru...
> >> fastcgi_max_temp_file_size 0;
> >
> >
> > Thanks Igor!
> > I assume that is an undocumented option, I couldn't find it in doc wiki
> > and
> > your site. Any downsides using it?
> 
> I guess that your fastcgi process will be stuck spoon-feeding slow clients
> instead of serving blazingly fast to nginx, which in turn spoon-feeds the
> clients... It defeats the purpose to use nginx as an accelerator.
> Fastcgi process are a scarce resource, you want them to be pinpointed as
> little as possible by the clients, to serve many short requests, unlike
> nginx whose been designed to serve many client in parallel.
> 
> If you have to serve big files, serve them with nginx and not directly by
> your PHP application. You can use X-Accel-Redirect for local PHP generated
> content...

You are right.

Some addition: if FastCGI response are big enough, but you do not want
to write them to disk, them you may increase nginx buffers:

fastcgi_buffer_size   4k;
fastcgi_buffers       128 4k;  # up to 4k + 128 * 4k
fastcgi_max_temp_file_size 0;

These directives is not dcoumented in wiki, however, they has the same
meaning as

http://wiki.codemongers.com/NginxHttpProxyModule#proxy_buffer_size
http://wiki.codemongers.com/NginxHttpProxyModule#proxy_buffers


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list