Dealing with too many open files

In this recipe, you will learn how to resolve a situation where the number of open files exceeds the maximum file limit set in the operating system.

How to do it...

  1. On trying to add a new minion to the master, the following error may be noticed in the log:
    [salt.master    ][INFO    ] Starting Salt worker process 38
    Too many open files
    sock != -1 (tcp_listener.cpp:335)
    
  2. Check the limit of maximum open files in the system:
    [root@salt-master ~]# ulimit -n
    1024
    
  3. Run the salt-master daemon in debug mode:
    [root@salt-master ~]# salt-master -l debug
    .
    .
    [INFO    ] salt-master is starting as user 'root'
    [INFO    ] Current values for max open files soft/hard setting: 1024/4096
    [INFO ] The value for the 'max_open_files' setting, 100000, ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.