{"id":1233,"date":"2019-01-11T13:51:45","date_gmt":"2019-01-11T13:51:45","guid":{"rendered":"http:\/\/www.ipcpu.com\/?p=1233"},"modified":"2019-06-11T13:53:10","modified_gmt":"2019-06-11T13:53:10","slug":"systemd-limitnofile-infinity-65536","status":"publish","type":"post","link":"https:\/\/c.ipcpu.com\/2019\/01\/systemd-limitnofile-infinity-65536\/","title":{"rendered":"systemd\u4e2d\u8bbe\u7f6eLimitNOFILE=infinity\u6700\u7ec8\u5374\u5f97\u523065536"},"content":{"rendered":"

systemd\u4e2d\u8bbe\u7f6eLimitNOFILE=infinity\u6700\u7ec8\u5374\u5f97\u523065536.md
\n<\/p>\n

\u5f15\u5165<\/h2>\n

\u5728CentOS7\u4e2d\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5047\u5982\u8bbe\u7f6eLimitNOFILE=infinity\uff0c\u6309\u7167\u5b57\u9762\u610f\u601d\u6765\u7406\u89e3\uff0c\u5e94\u8be5\u662funlimited\uff0c\u53ef\u662f\u53d1\u73b0\u5f97\u5230\u7684open files limit\u503c\u662f65536\uff0c\u89c9\u5f97\u5f88\u5947\u602a\uff0c\u4e8e\u662f\u505a\u4e86\u5982\u4e0b\u6d4b\u8bd5<\/p>\n

\u6d4b\u8bd5<\/h2>\n

\u6d4b\u8bd5\u673a\u73af\u5883\u60c5\u51b5\u5982\u4e0b<\/p>\n

\n
[root@ipcpu-s7 ~]# cat \/etc\/redhat-release \nCentOS Linux release 7.4.1708 (Core) \n[root@ipcpu-s7 ~]# uname -a\nLinux ipcpu-s7 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU\/Linux\n[root@ipcpu-s7 ~]# rpm -qa |grep systemd-sysv\nsystemd-sysv-219-42.el7_4.4.x86_64<\/code><\/pre>\n<\/div>\n

\u4ee5docker-ce-18.09.6-3.el7.x86_64\u8fd9\u4e2a\u5305\u4e3a\u4f8b\uff0cdocker-ce\u5728\/usr\/lib\/systemd\/system\/docker.service\u914d\u7f6e\u6587\u4ef6\u4e2d\u9884\u8bbe\u4e86 LimitNOFILE=infinity\uff0c\u4e8e\u662f\u6211\u4eec\u5f97\u5230\u4e86\u5982\u4e0b\u7ed3\u679c<\/p>\n

\n
[root@ipcpu-s7 ~]# cat \/proc\/`pidof dockerd`\/limits |grep files\nMax open files 65536 65536 files <\/code><\/pre>\n<\/div>\n

\u5982\u679c\u4e0d\u8bbe\u7f6e\uff0c\u6216\u8005\u8bbe\u7f6e\u4e3aLimitNOFILE=unlimited\uff08\u4e0d\u8bc6\u522b\uff09\uff0c\u5219\u5f97\u5230\u4e861024<\/p>\n

\n
[root@ipcpu-s7 ~]# cat \/proc\/`pidof dockerd`\/limits |grep files\nMax open files 1024 4096 files   <\/code><\/pre>\n<\/div>\n

\u5982\u679c\u8bbe\u7f6e\u4e3a42\u4e07\uff0cLimitNOFILE=420000\uff0c\u90a3\u4e48\u7ed3\u679c\u5982\u4e0b<\/p>\n

\n
[root@ipcpu-s7 ~]# cat \/proc\/`pidof dockerd`\/limits |grep files\nMax open files 420000 420000 files <\/code><\/pre>\n<\/div>\n

\u603b\u7ed3<\/h2>\n

\u5728CentOS7\u4e2dsystemd\u7684\u914d\u7f6e\u4e2d\uff0c\u8bbe\u7f6eLimitNOFILE=infinity\u5c31\u7b49\u4e8eLimitNOFILE=65536\uff0c\u4e00\u5b9a\u8981\u6ce8\u610f\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u9700\u6c4210\u4e07\u4ee5\u4e0a\u6587\u4ef6\u6253\u5f00\u6570\u7684\u4eba\uff0c\u4e00\u5b9a\u8981\u81ea\u884c\u8bbe\u5b9a\u3002<\/p>\n

\u6b64\u914d\u7f6e\u548cdocker\u65e0\u5173\uff0c\u4f7f\u7528nginx\u6d4b\u8bd5\u6548\u679c\u4e5f\u662f\u4e00\u6837\u3002\u8bf7\u77e5\u6089\u3002<\/p>\n

\u53d1\u73b0github\u5f88\u65e9\u5c31\u6709\u4eba\u53d1\u73b0\u8fd9\u4e2abug\u4e86\uff0c\u5982\u4e0b
\nhttps:\/\/github.com\/systemd\/systemd\/issues\/6559<\/a><\/p>\n

<\/p>\n

<\/div>\n
<\/div>\n
\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n<\/div>\n
\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n
<\/div>\n<\/div>\n

<\/wiz_tmp_tag><\/p>\n

\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1aIPCPU-\u7f51\u7edc\u4e4b\u8def<\/a> » systemd\u4e2d\u8bbe\u7f6eLimitNOFILE=infinity\u6700\u7ec8\u5374\u5f97\u523065536<\/a><\/p>","protected":false},"excerpt":{"rendered":"

systemd\u4e2d\u8bbe\u7f6eLimitNOFILE=infinity\u6700\u7ec8\u5374\u5f97\u523065536.md \u5f15\u5165 \u5728CentOS7\u4e2d\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5047\u5982\u8bbe\u7f6eLimitNOFILE=infinity\uff0c\u6309\u7167\u5b57\u9762\u610f\u601d\u6765\u7406\u89e3\uff0c\u5e94\u8be5\u662funlimited\uff0c\u53ef\u662f\u53d1\u73b0\u5f97\u5230\u7684open files limit\u503c\u662f65536\uff0c\u89c9\u5f97\u5f88\u5947\u602a\uff0c\u4e8e\u662f\u505a\u4e86\u5982\u4e0b\u6d4b\u8bd5 \u6d4b\u8bd5 \u6d4b\u8bd5\u673a\u73af\u5883\u60c5\u51b5\u5982\u4e0b [root@ipcpu-s7 ~]# cat \/etc\/redhat-release CentOS Linux release 7.4.1708 (Core) [root@ipcpu-s7 ~]# uname -a Linux ipcpu-s7 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU\/Linux [root@ipcpu-s7 ~]# rpm -qa |grep systemd-sysv systemd-sysv-219-42.el7_4.4.x86_64 \u4ee5docker-ce-18.09.6-3.el7.x86_64\u8fd9\u4e2a\u5305\u4e3a\u4f8b\uff0cdocker-ce\u5728\/usr\/lib\/systemd\/system\/docker.service\u914d\u7f6e\u6587\u4ef6\u4e2d\u9884\u8bbe\u4e86 LimitNOFILE=infinity\uff0c\u4e8e\u662f\u6211\u4eec\u5f97\u5230\u4e86\u5982\u4e0b\u7ed3\u679c [root@ipcpu-s7 ~]# cat \/proc\/`pidof dockerd`\/limits |grep files Max open files 65536 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[198,197],"_links":{"self":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1233"}],"collection":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/comments?post=1233"}],"version-history":[{"count":1,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1233\/revisions"}],"predecessor-version":[{"id":1234,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/posts\/1233\/revisions\/1234"}],"wp:attachment":[{"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/media?parent=1233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/categories?post=1233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c.ipcpu.com\/wp-json\/wp\/v2\/tags?post=1233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}