方法
查看
ulimit -Sn # soft limit; can be raised up to the hard limit
ulimit -Hn # hard limit
/etc/security/limits.conf
* - nofile 500000
Next, to ensure that these settings are applied, locate the file under /etc/pam.d that corresponds to your login method (/etc/pam.d/login for console, /etc/pam.d/lightdm for lightdm and so on) and add the following line unless it is already there:
session required pam_limits.so
这里可能根据需要改为
session /usr/lib64/pam_limits.so
fedoras上怪癖
## systemd
If you are on a systemd-based system,
try editing *both* `/etc/systemd/system.conf` and `/etc/systemd/user.conf`
and adding the following line under the `[Manager]`
section (see [systemd-system.conf(5)]
(https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html)):
DefaultLimitNOFILE=20000
Then reboot the system.
I found out about this setting from [a comment by Ewan Leith]
(https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1627769/comments/5),
but changing `user.conf` alone didn’t work for me;
I had to change both `user.conf` and `system.conf`.
网友评论