增加用户 open files limit

方法

查看
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`.
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 8,010评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 11,780评论 0 23
  • 曾经在安妮宝贝的一本书看过这样一句话,很是认同,于是便记了下来。那句话是这么说的:写作是一条个人道路,无需奢求理解...
    蹦跶的笔尖阅读 902评论 0 0
  • 彩琉易散钻恒坚, 善水漂流轻若闲。 心中忽起相思愁, 高楼无语空对月。 故人昨日锦书来, 感慨今宵彻难眠。 相忘江...
    明月映我心阅读 794评论 11 32
  • 《唉……》 实在是不知道该说些什么?_?前段时间脚歪住,贴上膏药,在家整整躺了一个星期才去上班,即使是好了,也是好...
    凤221阅读 170评论 0 0

友情链接更多精彩内容