Welcome! Log In Create A New Profile

Advanced

Tweaking FastCGI buffers settings

November 26, 2009 03:14AM
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
Subject Author Posted

Tweaking FastCGI buffers settings

rahul286 November 26, 2009 03:14AM

Re: Tweaking FastCGI buffers settings

Igor Sysoev November 26, 2009 08:56AM

Re: Tweaking FastCGI buffers settings

rahul286 November 26, 2009 09:19AM

Re: Tweaking FastCGI buffers settings

Rob Schultz November 26, 2009 11:30AM

Re: Tweaking FastCGI buffers settings

rahul286 November 27, 2009 01:28AM

Re: Tweaking FastCGI buffers settings

rahul286 November 27, 2009 01:33AM

Re: Tweaking FastCGI buffers settings

rahul286 November 27, 2009 02:32AM

Re: Tweaking FastCGI buffers settings

Igor Sysoev November 27, 2009 01:50AM

Re: Tweaking FastCGI buffers settings

Igor Sysoev November 27, 2009 01:52AM

Re: Tweaking FastCGI buffers settings

Igor Sysoev November 27, 2009 02:40AM

Re: Tweaking FastCGI buffers settings

Rob Schultz November 27, 2009 12:46PM

Re: Tweaking FastCGI buffers settings

Jeff Waugh November 26, 2009 11:44AM

Re: Tweaking FastCGI buffers settings

rahul286 November 27, 2009 03:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready