I am trying to increase the max open files for an application but my attempts have been unsuccessful. The hard limit is being set appropriately, but the soft limit is staying as the default 1024.
Under /etc/init.d/[application]
, under the start() function I have these two lines before any other commands are executed:
ulimit -Sn 64512 2> /dev/null
ulimit -Hn 80896 2> /dev/null
But when I check the limits under /proc/[pid]/limits
, the hard limit is 80896 but the soft limit is 1024.
Since the application is ran as root, I added a new .conf file under /etc/security/limits.d/
with the following entries:
root soft nofile 64512
root hard nofile 80896
But there is no change in /proc/[pid]/limits
.
How do I set max open files limits permanently for a specific application?
I'm testing in RHEL 6.10
ulimit
is for limiting the resource of a user. you better create a new user and change the ulimits for that user and run your application with it.