systemd version the issue has been seen with
centos7: systemd-219-42.el7.x86_64
arch linux: systemd 238.76-1
I found different systemd on different OS using different limits.
# centos 7.4
$ prlimit -p 1 | grep NOFILE
NOFILE max number of open files 65536 65536
Plain Text
복사
# archlinux
$ sudo prlimit -p 1 | grep NOFILE
NOFILE max number of open files 1048576 1048576 files
Plain Text
복사
I can not find a way to config this.
I also find if we use LimitNOFILE=infinity in *.service file, it is not a really infinity. it use the systemd (pid=1) limit as the infinity.
like
[root@node2 systemd]# prlimit -p 1
RESOURCE DESCRIPTION SOFT HARD UNITS
...
NOFILE max number of open files 65536 65536
...
[root@node2 systemd]# systemctl cat docker
# /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]
...
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
...
[root@node2 systemd]# systemctl show docker | grep NOFILE
LimitNOFILE=18446744073709551615
[root@node2 systemd]# ps aux | grep dockerd
root 868 0.1 0.9 1412052 79508 ? Ssl 09:34 0:02 /usr/bin/dockerd
root 7786 0.0 0.0 112664 976 pts/3 S+ 09:57 0:00 grep --color=auto dockerd
[root@node2 systemd]# prlimit -p 868
RESOURCE DESCRIPTION SOFT HARD UNITS
...
NOFILE max number of open files 65536 65536
...
Plain Text
복사