{"id":49696,"date":"2024-10-08T06:44:13","date_gmt":"2024-10-07T22:44:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49696\/"},"modified":"2024-10-08T06:44:13","modified_gmt":"2024-10-07T22:44:13","slug":"nginx-%e6%8a%80%e5%b7%a7%ef%bc%9a%e4%bd%bf%e7%94%a8-proxy_temp_file_write_size-%e9%80%b2%e8%a1%8c%e8%87%a8%e6%99%82%e6%96%87%e4%bb%b6%e5%af%ab%e5%85%a5","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49696\/","title":{"rendered":"Nginx \u6280\u5de7\uff1a\u4f7f\u7528 proxy_temp_file_write_size \u9032\u884c\u81e8\u6642\u6587\u4ef6\u5beb\u5165"},"content":{"rendered":"<h1 id=\"nginx-%e6%8a%80%e5%b7%a7%ef%bc%9a%e4%bd%bf%e7%94%a8-proxy_temp_file_write_size-%e9%80%b2%e8%a1%8c%e8%87%a8%e6%99%82%e6%96%87%e4%bb%b6%e5%af%ab%e5%85%a5-CgkoaIHBYr\">Nginx \u6280\u5de7\uff1a\u4f7f\u7528 proxy_temp_file_write_size \u9032\u884c\u81e8\u6642\u6587\u4ef6\u5beb\u5165<\/h1>\n<p>Nginx \u662f\u4e00\u500b\u9ad8\u6548\u80fd\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u53cd\u5411\u4ee3\u7406\u3001\u8ca0\u8f09\u5747\u8861\u548cHTTP\u5feb\u53d6\u7b49\u5834\u666f\u3002\u5728\u8655\u7406\u5927\u91cf\u8acb\u6c42\u6642\uff0cNginx \u7684\u6027\u80fd\u548c\u914d\u7f6e\u9078\u9805\u5c0d\u65bc\u7cfb\u7d71\u7684\u6574\u9ad4\u6548\u80fd\u81f3\u95dc\u91cd\u8981\u3002\u5176\u4e2d\uff0c<code>proxy_temp_file_write_size<\/code> \u662f\u4e00\u500b\u91cd\u8981\u7684\u6307\u4ee4\uff0c\u80fd\u5920\u5f71\u97ff\u81e8\u6642\u6587\u4ef6\u7684\u5beb\u5165\u884c\u70ba\uff0c\u9032\u800c\u5f71\u97ff\u4f3a\u670d\u5668\u7684\u6027\u80fd\u548c\u8cc7\u6e90\u4f7f\u7528\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-proxy_temp_file_write_size%ef%bc%9f-CgkoaIHBYr\">\u4ec0\u9ebc\u662f proxy_temp_file_write_size\uff1f<\/h2>\n<p><code>proxy_temp_file_write_size<\/code> \u6307\u4ee4\u7528\u65bc\u8a2d\u5b9a Nginx \u5728\u5beb\u5165\u81e8\u6642\u6587\u4ef6\u6642\u7684\u6700\u5927\u6578\u64da\u584a\u5927\u5c0f\u3002\u7576 Nginx \u4ee3\u7406\u8acb\u6c42\u4e26\u9700\u8981\u5c07\u97ff\u61c9\u5167\u5bb9\u5beb\u5165\u81e8\u6642\u6587\u4ef6\u6642\uff0c\u9019\u500b\u6307\u4ee4\u6703\u6c7a\u5b9a\u6bcf\u6b21\u5beb\u5165\u7684\u6578\u64da\u91cf\u3002\u9019\u5c0d\u65bc\u8655\u7406\u5927\u6587\u4ef6\u6216\u9ad8\u6d41\u91cf\u8acb\u6c42\u6642\u7684\u6027\u80fd\u512a\u5316\u5c24\u70ba\u91cd\u8981\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%9c%80%e8%a6%81%e8%aa%bf%e6%95%b4-proxy_temp_file_write_size%ef%bc%9f-CgkoaIHBYr\">\u70ba\u4ec0\u9ebc\u9700\u8981\u8abf\u6574 proxy_temp_file_write_size\uff1f<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u9ed8\u8a8d\u7684\u5beb\u5165\u5927\u5c0f\u53ef\u80fd\u7121\u6cd5\u6eff\u8db3\u7279\u5b9a\u61c9\u7528\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u7576\u8655\u7406\u5927\u6587\u4ef6\u4e0b\u8f09\u6216\u4e0a\u50b3\u6642\uff0c\u8f03\u5c0f\u7684\u5beb\u5165\u584a\u53ef\u80fd\u6703\u5c0e\u81f4\u983b\u7e41\u7684\u78c1\u789fI\/O\u64cd\u4f5c\uff0c\u5f9e\u800c\u5f71\u97ff\u6027\u80fd\u3002\u901a\u904e\u8abf\u6574 <code>proxy_temp_file_write_size<\/code>\uff0c\u53ef\u4ee5\u6e1b\u5c11\u9019\u4e9bI\/O\u64cd\u4f5c\u7684\u983b\u7387\uff0c\u5f9e\u800c\u63d0\u9ad8\u6574\u9ad4\u6027\u80fd\u3002<\/p>\n<h3 id=\"%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae-proxy_temp_file_write_size-CgkoaIHBYr\">\u5982\u4f55\u914d\u7f6e proxy_temp_file_write_size<\/h3>\n<p>\u8981\u914d\u7f6e <code>proxy_temp_file_write_size<\/code>\uff0c\u53ef\u4ee5\u5728 Nginx \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u6307\u4ee4\uff1a<\/p>\n<pre><code>http {\n    ...\n    proxy_temp_file_write_size 64k;  # \u8a2d\u5b9a\u70ba64KB\n    ...\n}<\/code><\/pre>\n<p>\u5728\u9019\u500b\u4f8b\u5b50\u4e2d\uff0c\u6211\u5011\u5c07\u5beb\u5165\u5927\u5c0f\u8a2d\u7f6e\u70ba 64KB\u3002\u6839\u64da\u5be6\u969b\u9700\u6c42\uff0c\u9019\u500b\u503c\u53ef\u4ee5\u8abf\u6574\u70ba\u66f4\u5927\u6216\u66f4\u5c0f\u7684\u6578\u5b57\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u904e\u5927\u7684\u5beb\u5165\u584a\u53ef\u80fd\u6703\u5c0e\u81f4\u5167\u5b58\u4f7f\u7528\u91cf\u589e\u52a0\uff0c\u56e0\u6b64\u5728\u8abf\u6574\u6642\u61c9\u8b39\u614e\u8003\u616e\u3002<\/p>\n<h2 id=\"%e5%af%a6%e9%9a%9b%e6%a1%88%e4%be%8b%e5%88%86%e6%9e%90-CgkoaIHBYr\">\u5be6\u969b\u6848\u4f8b\u5206\u6790<\/h2>\n<p>\u5047\u8a2d\u4e00\u500b\u7db2\u7ad9\u4f7f\u7528 Nginx \u4f5c\u70ba\u53cd\u5411\u4ee3\u7406\uff0c\u4e26\u4e14\u9700\u8981\u8655\u7406\u5927\u91cf\u7684\u8996\u983b\u6d41\u8acb\u6c42\u3002\u5982\u679c\u4e0d\u8abf\u6574 <code>proxy_temp_file_write_size<\/code>\uff0c\u6bcf\u6b21\u5beb\u5165\u7684\u6578\u64da\u91cf\u53ef\u80fd\u6703\u975e\u5e38\u5c0f\uff0c\u9019\u6703\u5c0e\u81f4\u78c1\u789fI\/O\u7684\u983b\u7e41\u64cd\u4f5c\uff0c\u5f9e\u800c\u5f71\u97ff\u7528\u6236\u7684\u89c0\u770b\u9ad4\u9a57\u3002\u901a\u904e\u5c07\u9019\u500b\u503c\u8abf\u6574\u70ba 128KB\uff0c\u7db2\u7ad9\u53ef\u4ee5\u986f\u8457\u6e1b\u5c11I\/O\u64cd\u4f5c\u7684\u6b21\u6578\uff0c\u5f9e\u800c\u63d0\u9ad8\u6574\u9ad4\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e7%9b%a3%e6%8e%a7%e5%92%8c%e8%aa%bf%e6%95%b4-CgkoaIHBYr\">\u76e3\u63a7\u548c\u8abf\u6574<\/h2>\n<p>\u5728\u5be6\u65bd\u4efb\u4f55\u914d\u7f6e\u66f4\u6539\u5f8c\uff0c\u6301\u7e8c\u76e3\u63a7\u4f3a\u670d\u5668\u7684\u6027\u80fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u53ef\u4ee5\u4f7f\u7528 Nginx \u7684\u65e5\u8a8c\u529f\u80fd\u4f86\u5206\u6790\u8acb\u6c42\u7684\u8655\u7406\u6642\u9593\u548c\u8cc7\u6e90\u4f7f\u7528\u60c5\u6cc1\u3002\u6839\u64da\u9019\u4e9b\u6578\u64da\uff0c\u9032\u4e00\u6b65\u8abf\u6574 <code>proxy_temp_file_write_size<\/code> \u7684\u503c\uff0c\u4ee5\u9054\u5230\u6700\u4f73\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-CgkoaIHBYr\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Nginx \u7684\u914d\u7f6e\u4e2d\uff0c<code>proxy_temp_file_write_size<\/code> \u662f\u4e00\u500b\u95dc\u9375\u7684\u6307\u4ee4\uff0c\u80fd\u5920\u986f\u8457\u5f71\u97ff\u81e8\u6642\u6587\u4ef6\u7684\u5beb\u5165\u6027\u80fd\u3002\u901a\u904e\u5408\u7406\u7684\u914d\u7f6e\u548c\u6301\u7e8c\u7684\u76e3\u63a7\uff0c\u7db2\u7ad9\u7ba1\u7406\u54e1\u53ef\u4ee5\u512a\u5316\u4f3a\u670d\u5668\u7684\u6027\u80fd\uff0c\u63d0\u5347\u7528\u6236\u9ad4\u9a57\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u7684\u61c9\u7528\uff0c\u7279\u5225\u662f\u5728\u8655\u7406\u5927\u6587\u4ef6\u6216\u9ad8\u6d41\u91cf\u8acb\u6c42\u6642\uff0c\u9019\u4e00\u6307\u4ee4\u7684\u8abf\u6574\u5c24\u70ba\u91cd\u8981\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u4f3a\u670d\u5668\u914d\u7f6e\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22 Nginx \u7684 proxy_temp_file_write_size \u8a2d\u5b9a\uff0c\u512a\u5316\u81e8\u6642\u6587\u4ef6\u5beb\u5165\u6027\u80fd\uff0c\u63d0\u5347\u7db2\u7ad9\u97ff\u61c9\u901f\u5ea6\u8207\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-49696","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=49696"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49696\/revisions"}],"predecessor-version":[{"id":49697,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49696\/revisions\/49697"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}