nginx warn an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/ while reading upstream


最近管理的nginx發現大量的error log,log內容如下:

an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/0/52/0002923520 while reading upstream

從這條error日志來看是nginx某一塊的buffer設置的太小,而response(包含response header和response body)導致response結果不得不臨時寫到文件中。

可以修改的配置參數

  client_header_buffer_size 128k;
  client_body_buffer_size 1m;
  proxy_buffer_size 32k;
  proxy_buffers 64 32k;
  proxy_busy_buffers_size 1m;
  proxy_temp_file_write_size 512k;

經過這樣的配置調整之后,基本上沒有這樣的error日志了。

關於這幾個配置的官方文檔鏈接如下

http://nginx.org/en/docs/http/ngx_http_core_module.html#directives

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#directives

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM