起进程提示open file too much

Author Avatar
贾康 4月 18, 2019
问题来源

ubuntu下需要起很多进程,跑了一会提示open file too much.

解决过程

默认是1024,调大就好了。但是试了几个都无效。

最终在这里找到了解决方案。

  1. Modify /etc/systemd/user.conf and /etc/systemd/system.conf with the following line (this takes care of graphical login):

    DefaultLimitNOFILE=65535

  2. Modify /etc/security/limits.conf with the following lines (this takes care of non-GUI login):

    username hard nofile 65535
    username soft nofile 65535

重启后生效