I faced with a problem which clients were failing to connect to a DB2 instance on linux. To check it out I logged on to the system as root and tried to "su" as instance user and got the following error message:

$ su - ctginst1
"cannot set user id: Resource temporarily unavailable" while trying to login or su as a local user in Red Hat Enterprise Linux

Issue was the user has reached the limit of maximum number of running processes which is set by nproc limit.

The resolution is change the limit for the user. In Red Hat 6 and above add a line for the user with higher limits as follow, mind the newly added last line:

$ vi /etc/security/limits.d/90-nproc.conf 

# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     1024
ctginst1   soft    nproc     65536 

Immediately after, problem is resolved.