6

Running caddy on a linux machine, and I receive the following error:

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

         Fix with "ulimit -n 8192"

Ok, great. But where do I fix it?

Chris
  • 28,822
  • 27
  • 83
  • 158

1 Answers1

9

For a temporary fix, you can simply issue the command ulimit -n 8192.

For permanent you need to modify /etc/security/limits.conf.

For more details please refer below:

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

From article:

vi /etc/security/limits.conf

Add two lines for each limit:

* soft nofile 16384
* hard nofile 16384

anothermh
  • 9,815
  • 3
  • 33
  • 52
Rehan Azher
  • 1,340
  • 1
  • 9
  • 17
  • 1
    And I recommend raising the NOFILES limit (ulimit -n) as high as you can, if your web server is the only primary purpose of the machine; you might as well, to make sure traffic spikes don't take you down. – Matt Apr 03 '18 at 15:28