- RHEL/CentOS 5
- RHEL/CentOS 6
- RHEL/CentOS 7
- RHEL/CentOS 8
The default configuration file for ulimit is /etc/security/limits.d/90-nproc.conf for (RHEL5, RHEL6), /etc/security/limits.d/20-nproc.conf for (RHEL7) and for RHEL 8 we have to create file /etc/security/limits.d/20-nproc.conf specifies the default
nproc limits as,:
* soft nproc 1024
root soft nproc unlimited
Even when logged in as root, the
ulimit shows a different value:
It is a bit confusing that it is not
unlimited in this case?
- Now we have a question in our mind that how to set or change the default
hard limit for the number of user’s processes?
If we have to set the
nproc limit to
unlimited for all system , Need to change in the file /etc/security/limits.d/90-nproc.conf (RHEL5, RHEL6), /etc/security/limits.d/20-nproc.conf (RHEL7, RHEL8) should read:
root hard nproc unlimited
For the ‘root’ user, both ‘soft’ and ‘hard’:
or, for default domain again both ‘soft’ and ‘hard’ for example:
unlimited option applied to the
soft value for a domain cannot go beyond its
Re-login for changes to take effect:
Another option to set the limits per session based is to specify it on the command line:
The above command applies to both
1- The pam of RHEL5 and RHEL8 don’t provide any files under /etc/security/limits.d. If necessary, make the file.
2- RHEL8 does not have the file /etc/security/limits.d/20-nproc.conf, so if you want to limit nproc on RHEL8, you need to create a file like /etc/security/limits.d/20-nproc.conf in /etc/security/limits.d/.
Now you have successfully increased ulimit to unlimited. Please share this article if helpful