使用 ulimit -n 8192 修复

Fix with ulimit -n 8192

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

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

         Fix with "ulimit -n 8192"

好的,很好。但是我在哪里修复它?

对于临时修复,您只需发出命令 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

Add two lines for each limit:

* soft nofile 16384
* hard nofile 16384