# Fastcgi\_buffers and fastcgi\_buffer\_size Q?

**URL:** <https://www.ruby-forum.com/t/fastcgi-buffers-and-fastcgi-buffer-size-q/202189>\
**Category:** NGINX\
**Created:** [January 24, 2011, 10:13am UTC](https://www.ruby-forum.com/t/fastcgi-buffers-and-fastcgi-buffer-size-q/202189 "2011-01-24T10:13:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 24, 2011, 10:13am UTC](https://www.ruby-forum.com/t/fastcgi-buffers-and-fastcgi-buffer-size-q/202189/1 "2011-01-24T10:13:52Z")

</div>

Hi Guys,  
after long googling and trying to find the right setup for nginx and  
fastcgi  
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  
process\_control\_timeout=0

pm=dynamic

pm.max\_children=65

```
                                           pm.start_servers=30

                   pm.min_spare_servers=30

```

pm.max\_spare\_servers=65

```
                                     pm.max_requests=10000

      request_slowlog_timeout = 15s

```

Posted at Nginx Forum:

> **[fastcgi\_buffers and fastcgi\_buffer\_size Q?](https://forum.nginx.org/read.php?2,169021,169021#msg-169021)**
>
> Hi Guys, after long googling and trying to find the right setup for nginx and fastcgi 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...

---

<div class="post-metadata">

**Author:** ![izrodix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3d9bf3/32.png) [@izrodix](https://www.ruby-forum.com/u/izrodix)\
**Post date:** [January 24, 2011, 10:45am UTC](https://www.ruby-forum.com/t/fastcgi-buffers-and-fastcgi-buffer-size-q/202189/2 "2011-01-24T10:45:55Z")

</div>

Jan 24 11:41:43.533118 [WARNING] [pool www] child 37693 exited on signal  
11 (SIGSEGV) after 116.541773 seconds from start  
Jan 24 11:41:43.533750 [NOTICE] [pool www child 38473 started  
Jan 24 11:41:44.288111 [WARNING] [pool www] child 38348 exited on signal  
10 (SIGBUS) after 60.120694 seconds from start  
Jan 24 11:41:44.289146 [NOTICE] [pool www] child 38475 started

Posted at Nginx Forum:

> **[fastcgi\_buffers and fastcgi\_buffer\_size Q?](https://forum.nginx.org/read.php?2,169021,169025#msg-169025)**
>
> Hi Guys, after long googling and trying to find the right setup for nginx and fastcgi 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...
