Why Do You Have a Discrepancy between the Maximum Number of File Descriptors between Your /etc/security/limits.conf File and What You Are Seeing in the Logs?

Problem scenario
You run a ulimit -Hn command.  You see the limit of the file descriptors to be what you expect.  But in the logs of an application, there is a discrepancy.  Why is one log reporting that the limit to file descriptors is different from the output of a "ulimit -Hn" or "ulimit -Sn" command?

Solution
Root cause
The ulimit -Hn and ulimit -Sn commands do not show the whole story.  Other application logs may be reporting true limits based on the user who started the service or the .service file associated with the application itself.

Procedures
1.  Go to this directory:  /etc/security/limits.d/

2.  Look at various files here.  These .conf files can override the global system setting.  Also note that .service files in /etc/systemd/system/ can have stanzas that will override the override setting in /etc/security/limits.d/ .conf files.

Leave a comment

Your email address will not be published. Required fields are marked *