{"id":46785,"date":"2023-12-11T15:09:48","date_gmt":"2023-12-11T07:09:48","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=46785"},"modified":"2023-12-11T15:09:48","modified_gmt":"2023-12-11T07:09:48","slug":"%e8%af%b7%e9%97%ae%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9%e6%96%87%e4%bb%b6%e6%9c%80%e5%a4%a7%e5%8f%a5%e6%9f%84%e6%95%b0%ef%bc%9f-3","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/11\/%e8%af%b7%e9%97%ae%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9%e6%96%87%e4%bb%b6%e6%9c%80%e5%a4%a7%e5%8f%a5%e6%9f%84%e6%95%b0%ef%bc%9f-3\/","title":{"rendered":"\u8bf7\u95ee\u5982\u4f55\u4fee\u6539\u6587\u4ef6\u6700\u5927\u53e5\u67c4\u6570\uff1f"},"content":{"rendered":"<p>&#8220;`&#8221;                    \u53c2\u8003\u56de\u7b54\uff1a<\/p>\n<p>linux\u9ed8\u8ba4\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570\u662f1024\u4e2a\uff0c\u5728linux\u670d\u52a1\u5668\u6587\u4ef6\u5e76\u53d1\u91cf\u6bd4\u8f83\u5927\u7684\u60c5\u51b5\u4e0b\uff0c\u7cfb\u7edf\u4f1a\u62a5&quot;&quot;too many open files&quot;&quot;\u7684\u9519\u8bef\u3002\u6545\u5728linux\u670d\u52a1\u5668\u9ad8\u5e76\u53d1\u8c03\u4f18\u65f6\uff0c\u5f80\u5f80\u9700\u8981\u9884\u5148\u8c03\u4f18Linux\u53c2\u6570\uff0c\u4fee\u6539Linux\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570\u3002<\/p>\n<p>\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a<\/p>\n<p>\\1. ulimit -n &lt;\u53ef\u4ee5\u540c\u65f6\u6253\u5f00\u7684\u6587\u4ef6\u6570&gt;\uff0c\u5c06\u5f53\u524d\u8fdb\u7a0b\u7684\u6700\u5927\u53e5\u67c4\u6570\u4fee\u6539\u4e3a\u6307\u5b9a\u7684\u53c2\u6570\uff08\u6ce8\uff1a\u8be5\u65b9\u6cd5\u53ea\u9488\u5bf9\u5f53\u524d\u8fdb\u7a0b\u6709\u6548\uff0c\u91cd\u65b0\u6253\u5f00\u4e00\u4e2ashell\u6216\u8005\u91cd\u65b0\u5f00\u542f\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u53c2\u6570\u8fd8\u662f\u4e4b\u524d\u7684\u503c\uff09<\/p>\n<p>\u9996\u5148\u7528ulimit -a\u67e5\u8be2Linux\u76f8\u5173\u7684\u53c2\u6570\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>&lt;pre&gt;&lt;code&gt;core file size          (blocks, -c) 0<br \/>\ndata seg size           (kbytes, -d) unlimited<br \/>\nscheduling priority             (-e) 0<br \/>\nfile size               (blocks, -f) unlimited<br \/>\npending signals                 (-i) 94739<br \/>\nmax locked memory       (kbytes, -l) 64<br \/>\nmax memory size         (kbytes, -m) unlimited<br \/>\nopen files                      (-n) 1024<br \/>\npipe size            (512 bytes, -p) 8<br \/>\nPOSIX message queues     (bytes, -q) 819200<br \/>\nreal-time priority              (-r) 0<br \/>\nstack size              (kbytes, -s) 8192<br \/>\ncpu time               (seconds, -t) unlimited<br \/>\nmax user processes              (-u) 94739<br \/>\nvirtual memory          (kbytes, -v) unlimited<br \/>\nfile locks                      (-x) unlimited<br \/>\n&lt;\/code&gt;&lt;\/pre&gt;<\/p>\n<p>\u5176\u4e2d\uff0copen files\u5c31\u662f\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570\uff0c\u9ed8\u8ba4\u662f1024\u4e2a\u3002<\/p>\n<p>\u4fee\u6539Linux\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570\uff1a  ulimit -n 2048\uff0c \u5c06\u6700\u5927\u53e5\u67c4\u6570\u4fee\u6539\u4e3a 2048\u4e2a\u3002<\/p>\n<p>\u00a0<\/p>\n<p>\\2. \u5bf9\u6240\u6709\u8fdb\u7a0b\u90fd\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u4fee\u6539Linux\u7cfb\u7edf\u53c2\u6570<\/p>\n<p>vi \/etc\/security\/limits.conf \u6dfb\u52a0<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;soft\u3000\u3000nofile\u3000\u300065536&lt;\/li&gt;<br \/>\n&lt;li&gt;hard\u3000\u3000nofile\u3000\u300065536&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p>\n<p>\u5c06\u6700\u5927\u53e5\u67c4\u6570\u6539\u4e3a65536<\/p>\n<p>\u4fee\u6539\u4ee5\u540e\u4fdd\u5b58\uff0c\u6ce8\u9500\u5f53\u524d\u7528\u6237\uff0c\u91cd\u65b0\u767b\u5f55\uff0c\u4fee\u6539\u540e\u7684\u53c2\u6570\u5c31\u751f\u6548\u4e86<\/p>\n<p>&lt;pre&gt;&lt;code&gt;            &quot;&#8220;`<br \/>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`&#8221; \u53c2\u8003\u56de\u7b54\uff1a linux\u9ed8\u8ba4\u6700\u5927\u6587\u4ef6\u53e5\u67c4\u6570\u662f1024\u4e2a\uff0c\u5728linux\u670d\u52a1\u5668\u6587\u4ef6\u5e76 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-46785","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/46785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=46785"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/46785\/revisions"}],"predecessor-version":[{"id":46786,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/46785\/revisions\/46786"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=46785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=46785"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=46785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}