Welcome! Log In Create A New Profile

Advanced

Re: Tweaking FastCGI buffers settings

Igor Sysoev
November 26, 2009 08:56AM
On Thu, Nov 26, 2009 at 03:14:48AM -0500, rahul286 wrote:

> First let me show my understanding of ngnix working till now...
>
> In my ngnix.conf - inside php-fastcgi handler block I have settings...
> fastcgi_buffers 64 4k;
> 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 line like an "upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/"
> Is this something to worry about?

This depends on typical repsonse size.

> As ngnix uses a function like below to allocate memory while sending PHP script response to client
> min(buffer_size,response_size)
> 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.

If a response is 12k then "fastcgi_buffers 64 4k" will allocated 3 buffers
of 4k. This is why fastcgi_buffers has two parameters, while
fastcgi_buffer_size (used for response header and first part) has just
one paramter. BTW, after fastcgi_buffer_size has been emptied, it used
together with fastcgi_buffers.


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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
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: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready