fastcgi_buffers and fastcgi_buffer_size Q?

izrodix nginx-forum at
Mon Jan 24 12:12:10 MSK 2011

Hi Guys,
after long googling and trying to find the right setup for nginx and
we came to three settings:
fastcgi_buffers, fastcgi_buffer_size and  fastcgi_read_timeout;

According to HttpFcgiModule manual the buffer size is equal to the size

of one buffer in fastcgi_buffers by default. Are this settings correct
because a few hours later we are still getting  BadGateway error ?

We are using Feebsd 8.2-STABLE amd64 jails and nginx from ports
sysctl hw.pagesize
hw.pagesize: 4096

fastcgi_connect_timeout 60;
fastcgi_send_timeout 20;
fastcgi_read_timeout 60;
fastcgi_buffers 512 4k;
fastcgi_buffer_size 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort     off;

    limit_req_zone $binary_remote_addr zone=antiddosphp:10m rate=1r/s;  
    limit_req_zone $binary_remote_addr zone=antiddos:10m rate=10r/s;    
    open_file_cache             max=100000 inactive=40s;                
    open_file_cache_valid       60s;                                    
    open_file_cache_min_uses    2;                                      
    open_file_cache_errors      on;  
client_max_body_size 150m;                                              
    ignore_invalid_headers   on;                                        
    recursive_error_pages    on;                                        
    sendfile    on;                                                     
    tcp_nopush  on;                                                     
    tcp_nodelay on;                                                     
    client_body_timeout   25;                                           
    client_header_timeout 5;                                            
    keepalive_timeout     25 5;                                         
    send_timeout          25;                                           
    reset_timedout_connection  on;        

Here is php-fpm settings
emergency_restart_threshold = 0
emergency_restart_interval = 0 

          request_slowlog_timeout = 15s

Posted at Nginx Forum:,169021,169021#msg-169021

More information about the nginx mailing list