cancel
Showing results for 
Search instead for 
Did you mean: 
jrios
Mission Specialist
Mission Specialist
  • 4,505 Views

open files

Jump to solution

Hey guys!

Got a question! Is there an way to set open file(nofile) to unlimited permanently? If so, is it recommended?

 

I was only able to set the max number of processes(nproc) value to unlimited in the /etc/security/limits.conf configuration file, but I couldn't set the same value to open file(nofile).

username        hard    nofile        1024000
username        soft    nofile        512000
username        hard    nproc        unlimited
username        soft    nproc        unlimited

 

Thanks in advance.

Labels (2)
0 Kudos
1 Solution

Accepted Solutions
Ricardo
Flight Engineer Flight Engineer
Flight Engineer
  • 4,497 Views

You need to restart the user session to load the new values. Also, the recomendation is to use the drop in folder /etc/security/limits.d instead of modifying the limits.conf directly.  

View solution in original post

2 Replies
Ricardo
Flight Engineer Flight Engineer
Flight Engineer
  • 4,498 Views

You need to restart the user session to load the new values. Also, the recomendation is to use the drop in folder /etc/security/limits.d instead of modifying the limits.conf directly.  

oldbenko
Moderator
Moderator
  • 4,454 Views

 


Is there an way to set open file(nofile) to unlimited permanently? If so, is it recommended?

Hey, @jrios!

From the limits.conf(5) manual:

All items support the values -1, unlimited or infinity indicating no
limit, except for priority and nice.

However, session limits set for number of open files by pam_limits.so can never override the /proc/sys/fs/file-max kernel setting which is calculated dynamically, based on the estimated system capacity.

Theoretically, you are on the safe side even if you set your hard limit to -1, but it wouldn't hurt to make it a fraction of what file-max is set to, depending on how many concurrent users you need to support.

(Useless trivia: on a 4-core, SMT, 32GB RAM, x86_64 RHEL7 workstation system running kernel version 3.10.0, file-max is 3233400.)

Cheers,

A black cat crossing the street signifies that the animal is going somewhere.
[don't forget to kudo a helpful post or mark it as a solution!]
0 Kudos
Join the discussion
You must log in to join this conversation.