ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

an upstream response is buffered to a temporary file

2021-11-26 18:31:45  阅读:451  来源: 互联网

标签:buffered temporary nginx proxy buffering response buffers size


Solution 1:

1) How can I remove the [warn] and avoid buffering responses? Is it better to turn off proxy_buffering or set proxy_max_temp_file_size to 0? Why?

You should set proxy_max_temp_file_size to 0 in order to remove it. The proxy_buffering directive isn't directly related to the warning. You can switch it off to stop any buffering at all but that isn't recommended in general (unless it's needed for Comet).

2) If nginx buffers a response when does it serve the buffered response, to whom and why?

It servers immediately, but a client usually has much slower connection and can't consume the response data as fast as it produced by your application. Nginx tries to buffer the whole response in order to release your application ASAP.

   

See also: http://aosabook.org/en/nginx.html

3) Why nginx turns proxy_buffering on by default and then [warn]s you if it actually buffers a response?

As I already mentioned, the proxy_buffering isn't directly related to the warning. It's generally needed for optimized proxy operations and turning it off degrades performance and throughput.

Nginx only warns you when a response doesn't fit into configured memory buffers. You may ignore the warning if it's ok for you.

4) When does a response triggers that option? When it takes > than some seconds (how many?) to serve the response? Is this configurable?

It triggers when memory buffers are full. Please, look at the docs, the whole mechanism is explained: http://nginx.org/r/proxy_max_temp_file_size

You may want to increase memory buffers.

Solution 2:

The following configuration works fine on my server.

proxy_buffers 16 16k;  
proxy_buffer_size 16k;

标签:buffered,temporary,nginx,proxy,buffering,response,buffers,size
来源: https://www.cnblogs.com/weifeng1463/p/15609071.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有