Feb 23 14:34:57 erpuatappl sshd[11618]: fatal: setresuid 501: Resource temporarily unavailable
Feb 23 14:41:15 erpuatappl sshd[11850]: error: do_exec_pty: fork: Resource temporarily unavailable
There can be various reasons for processes not being able to fork:
There is a misbehaving service or process running, consuming more resources than expected.
The system was not able to create new processes, because of the limits set for nproc in /etc/security/limits.conf.
The system ran out of memory and new processes were unable to start because they could not allocate memory.
There is not an available ID to assign to the new process. A unique value less than kernel.pid_max must be available.
There can be various reasons for processes not being able to fork and thus that means there are also various resolution:
1. When the system runs into a limitation in the number of processes, increase the nproc value in /etc/security/limits.conf or /etc/security/limits.d/90-nproc.conf depending on RHEL version.
2. The limit can be increased for a specific user or all users. For example, here is an example of /etc/security/limits.d/90-nproc.conf file.
<user> - nproc 2048 <<<----[ Only for "<user>" user ]
* - nproc 2048 <<<----[ For all user's ]
3. Check the total number of threads and processes running on the server:
[applmgr@erpuatappl ~]$ ps -eLf | wc -l
2332
[applmgr@erpuatappl ~]$ cat /proc/sys/kernel/pid_max
32768
kernel.pid_max must be larger than the total number of simultaneous threads and processes.
Diagnostic Steps:
Check with sar whether all memory was used or whether a large number of processes was spawned.
**In order to check the use of processes against what is allowed for the user, check the output of ulimit -u for the limit set to the particular user, and compare with the number of processes the user is runing.
**You can run the below command to find the number of processes opened for every user and compare if that limit is exceeded with what defined in /etc/security/limits.conf or /etc/security/limits.d/*.
1 dbus
1 gdm
1 rpc
1 rpcuser
2 postfix
3 68
3 rtkit
5 mfe
165 oracle
317 root
Add the following settings to /etc/security/limits.conf:
oracle hard nproc 16384
applmgr soft nofile 4096
applmgr hard nofile 65536
session required pam_limits.so
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
No comments:
Post a Comment