\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u53ef\u4ee5\u9488\u5bf9\u4e8e\u7279\u5b9a\u7684\u7528\u6237\uff0c\u4fee\u6539\u5176\u53e5\u67c4\u6570\u91cf\u3002\u8fd9\u5728\u5b89\u88c5es\u7b49\u5e94\u7528\u65f6\uff0c\u7ecf\u5e38\u78b0\u5230\u3002<\/p>\n
es - nofile 65535 \r\n<\/pre>\n\u4f46\u5373\u4f7f\u662f\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4e5f\u8981\u6c42\u4f60\u9700\u8981\u6253\u5f00\u4e00\u4e2a\u65b0\u7684shell\u8fdb\u884c\u64cd\u4f5c\u3002\u5728\u5f53\u524d\u4fee\u6539\u7684shell\u91cc\u6216\u8005\u4fee\u6539\u4e4b\u524d\u7684shell\u91cc\uff0c\u540c\u6837\u4e0d\u751f\u6548\u3002xjjdog\u5c31\u66fe\u9047\u5230\u8fc7\u591a\u8d77\u8fd9\u6837\u660e\u660e\u653e\u5f00\u4e86\u9650\u5236\uff0c\u4f46\u8fd8\u662f\u53d1\u751f\u95ee\u9898\u7684\u6848\u4f8b\u3002<\/p>\n
\u8981\u770b\u5230\u8fd9\u4e9b\u6539\u53d8\u662f\u5426\u5df2\u7ecf\u5bf9\u8fdb\u7a0b\u751f\u6548\uff0c\u53ef\u4ee5\u67e5\u770b\u8fdb\u7a0b\u7684\u5185\u5b58\u6620\u5c04\u6587\u4ef6\u3002\u6bd4\u5982cat \/proc\/180323\/limits\uff0c\u5176\u4e2d\u4f1a\u6709\u8be6\u7ec6\u7684\u5c55\u793a\u3002<\/p>\n
\u8fd9\u4e2a\u6570\u503c\uff0c\u4e5f\u5e76\u4e0d\u662f\u60f3\u8981\u8bbe\u591a\u5927\u5c31\u591a\u5927\u7684\u3002\u5b83\u7684\u5927\u5c0f\u4e0a\u9650\uff0c\u662f\u7531nr_open\u51b3\u5b9a\u7684\u3002\u60f3\u8981\u66f4\u5927\uff0c\u5c31\u8981\u4fee\u6539\/ect\/sysct.conf \u4e2dfs.nr_open\u7684\u503c\u3002<\/p>\n
cat \/proc\/sys\/fs\/nr_open \r\n1048576 \r\n<\/pre>\n\u90a3file-max\u53c8\u8be5\u5982\u4f55\u4fee\u6539\u5462?\u5efa\u8bae\u4fee\u6539\/etc\/sysctl.conf\u6587\u4ef6\uff0c\u52a0\u5165\u4e0b\u9762\u5185\u5bb9\u3002\u8db3\u8db3\u67096\u767e\u591a\u4e07!<\/p>\n
fs.file-max = 6553560 \r\n<\/pre>\n\u5f53\u6587\u4ef6\u6570\u91cf\u8d85\u51fa\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u62a5kernel: VFS: file-max limit 65535 reached\u7684\u9519\u8bef\u3002<\/p>\n
\u603b\u7ed3\u4e00\u4e0b\u3002<\/p>\n
<\/p>\n
Linux\u5373\u4f7f\u653e\u5f00\u4e00\u4e2a\u7aef\u53e3\uff0c\u80fd\u591f\u63a5\u53d7\u7684\u8fde\u63a5\u4e5f\u662f\u6d77\u91cf\u7684\u3002\u8fd9\u4e9b\u8fde\u63a5\u7684\u4e0a\u9650\uff0c\u53d7\u5230\u5355\u8fdb\u7a0b\u6587\u4ef6\u53e5\u67c4\u6570\u91cf\u548c\u64cd\u4f5c\u7cfb\u7edf\u6587\u4ef6\u53e5\u67c4\u6570\u91cf\u7684\u9650\u5236\uff0c\u4e5f\u5c31\u662fulimit\u548cfile-max\u3002<\/p>\n
\u4e3a\u4e86\u80fd\u591f\u5c06\u53c2\u6570\u4fee\u6539\u6301\u4e45\u5316\uff0c\u6211\u4eec\u503e\u5411\u4e8e\u5c06\u6539\u52a8\u5199\u5165\u5230\u6587\u4ef6\u91cc\u3002\u8fdb\u7a0b\u7684\u6587\u4ef6\u53e5\u67c4\u9650\u5236\uff0c\u53ef\u4ee5\u653e\u5728\/etc\/security\/limits.conf\u4e2d\uff0c\u5b83\u7684\u4e0a\u9650\u53d7\u5230fs.nr_open\u7684\u5236\u7ea6;\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u53e5\u67c4\u9650\u5236\uff0c\u53ef\u4ee5\u653e\u5230\/etc\/sysctl.conf\u6587\u4ef6\u4e2d\u3002\u6700\u540e\uff0c\u522b\u5fd8\u4e86\u5728\/proc\/$id\/limits\u6587\u4ef6\u4e2d\uff0c\u786e\u8ba4\u4fee\u6539\u662f\u5426\u5bf9\u8fdb\u7a0b\u751f\u6548\u4e86\u3002<\/p>\n
\u5982\u6b64\uff0c\u767e\u4e07\u8fde\u63a5\u624d\u540d\u4e0d\u865a\u4f20\u3002\u6211\u6bd4\u8f83\u5947\u602a\u7684\u662f\uff0c\u4e3a\u4ec0\u4e48Linux\u4e0d\u9ed8\u8ba4\u653e\u5f00\u8fd9\u4e9b\u914d\u7f6e\u5462?\u505a\u621065535\u4e5f\u8ba4\u554a\uff0c\u4e3a\u4ec0\u4e48\u641e\u4e2a1024?<\/p>\n","protected":false},"excerpt":{"rendered":"
\u6700\u8fd1\u9047\u5230\u4e00\u4e2a\u975e\u5e38\u6709\u8da3\u7684\u95ee\u9898\u3002\u5176\u4e2d\u6709\u4e00\u7ec4HAProxy\uff0c\u9891\u7e41\u51fa\u73b0\u95ee\u9898\u3002\u767b\u5f55\u4e0a\u670d\u52a1\u5668\uff0ccpu\u3001\u5185\u5b58\u3001\u7f51\u7edc\u3001io\u4e00\u987f […]<\/p>\n","protected":false},"author":1329,"featured_media":208694,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-208687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/208687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=208687"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/208687\/revisions"}],"predecessor-version":[{"id":208733,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/208687\/revisions\/208733"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/208694"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=208687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=208687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=208687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}