Confused about proxy_buffer_size and proxy_buffers

Dave Cheney dave at
Wed Apr 30 05:15:14 MSD 2008


	I am trying to tune our nginx frontends (proxying a pack of mongrels)  
to avoid this type of message

2008/04/30 11:06:50 [warn] 35585#0: *40967931 an upstream response is  
buffered to a temporary file /opt/local/var/run/nginx/proxy_temp/ 
0/58/0000370580 while reading upstream, client:,  
server:, request: "GET /people/basiamc/art/732916-4- 
fire-fairy? HTTP/1.0", upstream: " 
", host: "", referrer: " 

	A little bit of curling reveals that our minimum page size is between  
11k and 14k, but can be up to 35k for the common pages. So I have set

	proxy_buffer_size 32k

	In the expectation that this buffer will be allocated for all proxy  
requests before the overflow into proxy_buffers.

	For pages that have a large number of comments the sizes can range up  
to 150k but even with a setting like this

	proxy_buffers 128	4k;

	which should yield a maximum buffer of 546k, this request

[dave at crimson ~]$ curl -I
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 30 Apr 2008 01:13:45 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: _session_id=1263f18e47b978d84cab76592cf240c4; path=/
Cache-Control: private, max-age=0, must-revalidate
Content-Length: 282541

	Generates a warning.

	Should I continue to increase the buffer size? Should I allocate the  
buffer in larger sizes? Is there an interaction with proxy_buffers and  
gzip or the output buffer settings ?



More information about the nginx mailing list