# An upstream response is buffered to a temporary file

**URL:** <https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061>\
**Category:** NGINX\
**Created:** [October 21, 2011, 9:36pm UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061 "2011-10-21T21:36:57Z")\
**Posts on this page:** 5\
**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:** [October 21, 2011, 9:36pm UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061/1 "2011-10-21T21:36:57Z")

</div>

What settings / parameters can be tweaked to increase the amount of  
buffers available as to not go to a temporary file?

We are seeing many of these:

2011/10/21 14:01:24 [warn] 24547#0: \*2408454 an upstream response is  
buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695  
while reading upstream, client: 1.1.1.1, server: [www.someserver.com](http://www.someserver.com),  
request: “GET /edit.html?id=6816841 HTTP/1.1”, upstream:  
“fastcgi://192.168.1.5:9000”, host: “[www.someserver.com](http://www.someserver.com)”, referrer:  
“[http://www.someserver.com/c.html](http://www.someserver.com/c.html)”

I tried messing around with proxy\_buffer settings, but not sure if I’m  
on the right track.

Thanks

Posted at Nginx Forum:

> **[An upstream response is buffered to a temporary file](https://forum.nginx.org/read.php?2,217034,217034#msg-217034)**
>
> What settings / parameters can be tweaked to increase the amount of buffers available as to not go to a temporary file? We are seeing many of these: 2011/10/21 14:01:24 \[warn\] 24547#0: \*2408454 an upstream response is buffered to a temporary file...

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 21, 2011, 9:44pm UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061/2 "2011-10-21T21:44:22Z")

</div>

Hello!

On Fri, Oct 21, 2011 at 03:36:23PM -0400, iberkner wrote:

> “[http://www.someserver.com/c.html](http://www.someserver.com/c.html)”
> 
> I tried messing around with proxy\_buffer settings, but not sure if I’m  
> on the right track.

This is a warning message which is here to let you know that  
response was buffered to disk. Depending on your use case you may  
want either to tune fastcgi\_buffers/fastcgi\_buffer\_size, or disable  
disk buffering with “fastcgi\_max\_temp\_file 0”, or just ignore this  
warning.

Maxim D.

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 21, 2011, 10:02pm UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061/3 "2011-10-21T22:02:55Z")

</div>

Thanks,

I increased the fastcgi\_buffers as follows:

fastcgi\_buffers 256 4k;

and that took care of this problem.

Another problem I’m trying to deal with is:

netstat -an|awk ‘/tcp/ {print $6}’|sort|uniq -c  
12 CLOSING  
1176 ESTABLISHED  
58 FIN\_WAIT1  
218 FIN\_WAIT2  
23 LAST\_ACK  
43 LISTEN  
91 SYN\_RECV  
3606 TIME\_WAIT

I’m trying to understand why there are so many connections in TIME\_WAIT  
status. Any ideas on how to research this issue?

On Fri, Oct 21, 2011 at 3:44 PM, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > buffered to a temporary file /var/lib/nginx/fastcgi/5/69/0000017695  
> > want either to tune fastcgi\_buffers/fastcgi\_buffer\_size, or disable  
> > disk buffering with “fastcgi\_max\_temp\_file 0”, or just ignore this  
> > warning.
> 
> Maxim D.
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–

Ilan B.  
Chief Technology Officer

> **[Online Homeschool Curriculum from Time4Learning](https://www.time4learning.com/)**
>
> PreK-12 homeschooling is EASY with Time4Learning at your fingertips with award-winning online lessons, and parent-friendly planning and reporting tools.

6300 NE 1st Ave., Suite 203  
Ft. Lauderdale, FL 33334  
(954) 771-0914

[http://www.twitter.com/time4learning](http://www.twitter.com/time4learning)  
[http://www.facebook.com/Time4Learning](http://www.facebook.com/Time4Learning)

[Time4Learning.com](http://Time4Learning.com) - Online interactive curriculum for home use, PreK-8th  
Grade.  
[Time4Writing.com](http://Time4Writing.com) - Online writing tutorials for high, middle, and  
elementary  
school students.  
[Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
education, parenting and more.  
[spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for  
teachers,  
parents and students.

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 21, 2011, 10:10pm UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061/4 "2011-10-21T22:10:59Z")

</div>

I read online that making these changes:

echo 1 \> /proc/sys/net/ipv4/tcp\_tw\_recycle

echo 1 \> /proc/sys/net/ipv4/tcp\_tw\_reuse  
can potentially have a good impact on performance but can also increase  
connection drops.

Any thoughts?

On Fri, Oct 21, 2011 at 4:02 PM, Ilan B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> netstat -an|awk ‘/tcp/ {print $6}’|sort|uniq -c  
> status. Any ideas on how to research this issue?
> 
> > > We are seeing many of these:
> > 
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> elementary school students.  
> [Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
> education, parenting and more.  
> [spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for teachers,  
> parents and students.

–

Ilan B.  
Chief Technology Officer

> **[Online Homeschool Curriculum from Time4Learning](https://www.time4learning.com/)**
>
> PreK-12 homeschooling is EASY with Time4Learning at your fingertips with award-winning online lessons, and parent-friendly planning and reporting tools.

6300 NE 1st Ave., Suite 203  
Ft. Lauderdale, FL 33334  
(954) 771-0914

[http://www.twitter.com/time4learning](http://www.twitter.com/time4learning)  
[http://www.facebook.com/Time4Learning](http://www.facebook.com/Time4Learning)

[Time4Learning.com](http://Time4Learning.com) - Online interactive curriculum for home use, PreK-8th  
Grade.  
[Time4Writing.com](http://Time4Writing.com) - Online writing tutorials for high, middle, and  
elementary  
school students.  
[Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
education, parenting and more.  
[spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for  
teachers,  
parents and students.

---

<div class="post-metadata">

**Author:** ![iberkner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c67d28/32.png) [@iberkner](https://www.ruby-forum.com/u/iberkner)\
**Post date:** [October 26, 2011, 7:48am UTC](https://www.ruby-forum.com/t/an-upstream-response-is-buffered-to-a-temporary-file/213061/5 "2011-10-26T07:48:19Z")

</div>

For time\_wait issue., pls try keepalive enable if it act as proxy.

2011/10/22, Ilan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> netstat -an|awk ‘/tcp/ {print $6}’|sort|uniq -c  
> status. Any ideas on how to research this issue?
> 
> > > We are seeing many of these:
> > 
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> [Time4Writing.com](http://Time4Writing.com) - Online writing tutorials for high, middle, and elementary  
> school students.  
> [Time4Learning.net](http://Time4Learning.net) - A forum to chat with parents online about kids,  
> education, parenting and more.  
> [spellingcity.com](http://spellingcity.com) - Online vocabulary and spelling activities for teachers,  
> parents and students.

–  
ҵƶ豸
