{"id":319467,"date":"2021-02-05T07:54:39","date_gmt":"2021-02-04T23:54:39","guid":{"rendered":"http:\/\/4563.org\/?p=319467"},"modified":"2021-02-05T07:54:39","modified_gmt":"2021-02-04T23:54:39","slug":"%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e6%af%94%e5%8e%9f%e6%8e%a5%e5%8f%a3%e6%80%a7%e8%83%bd%e8%bf%98%e4%bd%8e%e6%98%af%e6%80%8e%e4%b9%88%e5%9b%9e%e4%ba%8b%e5%91%a2%ef%bc%8c%e8%83%bd%e4%b8%8d%e8%83%bd","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=319467","title":{"rendered":"\u53cd\u5411\u4ee3\u7406\u6bd4\u539f\u63a5\u53e3\u6027\u80fd\u8fd8\u4f4e\u662f\u600e\u4e48\u56de\u4e8b\u5462\uff0c\u80fd\u4e0d\u80fd\u6539\u5584"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u53cd\u5411\u4ee3\u7406\u6bd4\u539f\u63a5\u53e3\u6027\u80fd\u8fd8\u4f4e\u662f\u600e\u4e48\u56de\u4e8b\u5462\uff0c\u80fd\u4e0d\u80fd\u6539\u5584               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bombless <\/span>  <span><i><\/i> 9<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u53cd\u5411\u4ee3\u7406\u672c\u8eab\u7684\u914d\u7f6e\u5c31\u662f\u5f88\u666e\u901a\u7684<\/p>\n<p> location \/ {<br \/> #proxy_buffering off;<br \/> root html;<br \/> index index.html index.htm;<br \/> #proxy_buffers 8 4m;<br \/> #proxy_busy_buffers_size 25m;<br \/> #proxy_buffer_size 512k;<br \/> #proxy_ignore_headers &#8220;Cache-Control&#8221; &#8220;Expires&#8221;;<br \/> #proxy_max_temp_file_size 0;<br \/> proxy_connect_timeout 300;<br \/> proxy_read_timeout 300;<br \/> proxy_send_timeout 300;<br \/>  proxy_intercept_errors off;<br \/> proxy_pass http:\/\/api;<br \/> proxy_set_header Host $host:$server_port;<br \/> proxy_set_header X-Real-IP $remote_addr;<br \/> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/> proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;<br \/> proxy_set_header X-Forwarded-Proto https;<br \/> #proxy_set_header Forwarded &#8220;$proxy_add_forwarded;proto=$scheme&#8221;;<br \/> }<\/p>\n<p>\u8fd9\u6837\u7684\uff0c\u8fd8\u6709\uff1a<\/p>\n<p>worker_rlimit_nofile 655350;<br \/>events {<br \/> worker_connections 5000000;<br \/>}<\/p>\n<p>\u6211\u6d4b\u7684\u662f\u5217\u8868\u63a5\u53e3\uff0c\u4ece\u539f\u63a5\u53e3\u7528 jmeter \u7ed9 1000 \u4e2a\u7ebf\u7a0b\uff0c\u539f\u63a5\u53e3\u5f97\u5230\u7684\u541e\u5410\u91cf\u662f 200 \u591a\u4e2a\u64cd\u4f5c\u6bcf\u79d2\uff0c<br \/>\u4f46\u53cd\u5411\u4ee3\u7406\u7684\u63a5\u53e3\u53ea\u6709 20 \u591a\u4e0d\u8bf4\uff0c\u6709 20%\u7684\u8bf7\u6c42\u8fd4\u56de\u7684\u662f read timeout<br \/>\u63a5\u6536\u6570\u636e\u91cf\u539f\u63a5\u53e3\u662f 6MB\/s\uff0c\u53cd\u5411\u4ee3\u7406\u51fa\u7684\u63a5\u53e3\u662f 500KB\/s<\/p>\n<p>\u6d4b\u8bd5\u7684\u65f6\u5019 nginx \u90a3\u53f0\u673a\u5668\u7684 cpu \u548c\u5185\u5b58\u5360\u7528\u90fd\u6ca1\u4ec0\u4e48\u6ce2\u52a8\uff0c\u6240\u4ee5\u673a\u5668\u6027\u80fd\u4e0d\u591f\u5e94\u8be5\u4e0d\u662f\u4e3b\u8981\u539f\u56e0<\/p>\n<p>\u81f3\u4e8e\u8bf4\u4e3a\u4ec0\u4e48\u53cd\u5411\u4ee3\u7406\u662f\u56e0\u4e3a nginx \u7684\u8fd9\u53f0\u673a\u5668\u624d\u5728\u516c\u7f51\u4e0a<\/p>\n<p>\u53cd\u5411\u4ee3\u7406\u6ca1\u5f00\u7f13\u5b58\u662f\u56e0\u4e3a\u8fd9\u4e2a\u662f\u4e2a post \u63a5\u53e3\uff0c\u5ba2\u6237\u7aef\u5df2\u7ecf\u53d1\u51fa\u53bb\u4e86\u63a5\u53e3\u4e0d\u4f1a\u6539\u4e3a get \u4e86\uff0c\u5e76\u4e14\u8fd9\u91cc\u4f1a\u7edf\u8ba1\u7528\u6237\u8bbf\u95ee\u6570\u6240\u4ee5\u4e5f\u4e0d\u597d\u7f13\u5b58<\/p>\n<p>\u5c31\u60f3\u4e86\u89e3\u4e00\u4e0b\u53cd\u5411\u4ee3\u7406\u7684\u63a5\u53e3\u80fd\u4e0d\u80fd\u541e\u5410\u548c\u539f\u63a5\u53e3\u63a5\u8fd1\u5462\uff0c\u6709\u6ca1\u6709\u61c2\u7684\u8bf4\u8bf4      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5020936\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jk1030 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1.\u4e3a\u4ec0\u4e48\u4e0d\u8003\u8651\u4e0b\u516c\u7f51\u7684\u5e26\u5bbd\u5462<br \/>2.\u52a0\u4e86\u4ee3\u7406\u5c42\u80af\u5b9a\u6bd4\u539f\u6765\u7684\u5dee<br \/>3.\u7528\u6237\u8bbf\u95ee\u6570\u4e0d\u80fd\u7528 nginx \u6765\u7edf\u8ba1\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020937\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yeqizhang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u591a\u534a\u662f\u4f60\u63a5\u53e3\u95ee\u9898\u6216\u8005\u7f51\u7edc\u95ee\u9898\uff0c\u5e76\u53d1\u91cf\u8bbe\u7f6e\u7684\u4e00\u6837\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020938\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : walkfish <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             http version \u8bbe\u6210 1.1\uff0c\u4e0d\u7136\u6ca1\u6709\u94fe\u63a5\u590d\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020939\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : walkfish <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             proxy_http_version 1.1;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020940\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : superrichman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60 root \u548c proxy_pass \u5199\u4e00\u8d77\uff0c\u6211\u731c nginx \u63a5\u53d7\u6bcf\u4e2a\u8bf7\u6c42\u90fd\u8981\u628a html \u76ee\u5f55\u626b\u63cf\u4e00\u904d\uff0c\u6ca1\u627e\u5230\u6587\u4ef6\u624d\u628a\u8bf7\u6c42\u8f6c\u7ed9\u4f60\u7684\u5e94\u7528\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020941\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : coolesting <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             location \/ { <br \/>#<br \/>}<\/p>\n<p># \u8fd9\u6837\u7684\u5199\u6cd5\u76f8\u5f53\u4e8e -&gt; select * from user ;<br \/># \u4f60\u8bf4\u6162\u4e0d\u6162\u5462\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020942\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qwerthhusn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8981\u7528 upstream \u7684 keepalive<br \/>\u7136\u540e proxy \u53bb keepalive \u8fde\u63a5\uff0c\u4f1a\u597d\u70b9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5020943\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bombless <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u591a\u8c22\u5404\u4f4d\u7684\u5efa\u8bae\u3002<\/p>\n<p>\u6211\u624d\u53d1\u73b0\u662f\u6211\u6d4b\u7684\u65f6\u5019\u539f\u63a5\u53e3\u90fd\u662f\u5728\u5185\u7f51\u6d4b\u7684\uff0c\u53cd\u5411\u4ee3\u7406\u90fd\u662f\u8d70\u516c\u7f51\u7684\u624d\u6709\u8fd9\u4e2a\u533a\u522b<\/p>\n<p>\u6211\u76f4\u63a5\u5728\u5185\u7f51\u6d4b\u53cd\u5411\u4ee3\u7406\u5c31\u53ef\u4ee5\u770b\u5230\u5176\u5b9e\u53cd\u5411\u4ee3\u7406\u4e4b\u540e\u6027\u80fd\u5dee\u4e0d\u591a\u7684<\/p>\n<p>\u4f46\u662f\u73b0\u5728\u516c\u7f51\u90a3\u4e48\u591a read timeout \u4e5f\u5f88\u5934\u75bc\uff0c\u4f46\u8fd9\u5c31\u662f\u53e6\u4e00\u4e2a\u95ee\u9898\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u53cd\u5411\u4ee3\u7406\u6bd4\u539f\u63a5\u53e3\u6027\u80fd\u8fd8\u4f4e\u662f\u600e\u4e48\u56de\u4e8b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/319467"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319467"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/319467\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319467"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}