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.