修复ulimit -n 8192

时间:2018-04-03 14:28:00

标签: linux caddy

在linux机器上运行caddy,我收到以下错误:

WARNING: File descriptor limit 1024 is too low for production servers.
         At least 8192 is recommended. 

         Fix with "ulimit -n 8192"

好的,太好了。但是我在哪里修理它?

1 个答案:

答案 0 :(得分:4)

对于临时修复,您只需发出命令ulimit -n 8192

对于永久性,您需要修改/etc/security/limits.conf

有关详细信息,请参阅以下内容:

https://singztechmusings.wordpress.com/2011/07/11/ulimit-how-to-permanently-set-kernel-limits-in-linux/

来自文章:

  

vi /etc/security/limits.conf

     

为每个限制添加两行:

     

* soft nofile 16384
  * hard nofile 16384