Upping the Soft nproc Limit
This is just a quick note to myself about increasing the “soft nproc” value. On one of the RHEL 6 Tomcat servers I got the following error when trying to “su – tomcat”:
su: cannot set user id: Resource temporarily unavailable
The issue is likely caused by the tomcat user hitting the soft process limit. Step one is to count the number of processes running under tomcat UID:
root@devtomcat01# ps -eLF | grep [t]omcat | wc -l 1024
Immediately, the 1024 value looks suspicious as it is the common default soft nproc limit. You can check limits.conf:
grep nproc /etc/security/limits.conf
I found nothing of interest there. The more promising location to check is /etc/security/limits.d/90-nproc.conf:
root@devtomcat01# grep nproc /etc/security/limits.d/90-nproc.conf * soft nproc 1024 root soft nproc unlimited
And there it is: the default soft nproc limit for all users (except root) is 1024. Change that to 131072 and save the file. No reboots or restarts are needed. The problem should be resolved immediately.