Operating System - HP-UX
1821832 Members
3508 Online
109638 Solutions
New Discussion юеВ

Re: sh: The fork function failed. Too many processes already exist.

 
SOLVED
Go to solution
Deepu Chakravarty
Regular Advisor

sh: The fork function failed. Too many processes already exist.

Login to the server taking too long. No command working and giving the following error.
$ l -slt|pg

sh: The fork function failed. Too many processes already exist.
$

Besides shutdown the server what are the other way of doing away with the too manay processess ?
9 REPLIES 9
Pete Randall
Outstanding Contributor
Solution

Re: sh: The fork function failed. Too many processes already exist.

Your ultimate solution is going to require increasing the nprocs kernel parameter (or maybe maxusers and let the formulas increase other paramters accordingly). Use SAM to do this. If you can't log in at all, you may need to reboot in single user mode to make this change.


Pete

Pete
T G Manikandan
Honored Contributor

Re: sh: The fork function failed. Too many processes already exist.

Increase maxuprc on the kernel.

When you increase nproc this should inturn increase this!
Vijaya Kumar_3
Respected Contributor

Re: sh: The fork function failed. Too many processes already exist.

Also try to shutdown some other processes (other than system processes).

Check your current kernel parameters with sysdef or kmtune commands.

Use SAM to increase the kernel parameter:
nproc

Reboot

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
john korterman
Honored Contributor

Re: sh: The fork function failed. Too many processes already exist.

Hi,
either the max number of processes has been reached, or (I think) it may be caused by reaching the max number of processes for one user. You can of course increase these values, but check alos that you do not have an application running amok, e.g. by blindly starting processes from crontab or the like.

regards,
John K.
it would be nice if you always got a second chance
T G Manikandan
Honored Contributor

Re: sh: The fork function failed. Too many processes already exist.

Also check whether the user has a program which uses fork function to spawn processes.

#ps -ef|grep

check what processes he is running.

If the values are low on the kernel then you need to increase teh values

nproc---number of system wide process limit
maxuprc--user wide processes limit
Elmar P. Kolkman
Honored Contributor

Re: sh: The fork function failed. Too many processes already exist.

Before increasing the possible number of processes, take a look at the processes running. Perhaps some malfunctioning program is creating lots or processes. Now the problem you have is that you can't start processes to look at this.

So try to stop some processes (if on your own desktop, kill things like xclock and xload to get some air. And if nothing else helps you could run processes with exec, but that would log you out the moment the process ends. Syntax would be 'exec '.
Every problem has at least one solution. Only some solutions are harder to find.
John Carr_2
Honored Contributor

Re: sh: The fork function failed. Too many processes already exist.

Hi

we had a problem like this many years ago where an application was spawning more processes than the server could cope with. we increased parameters to run but this just delayed the inevitable. Check for any applications which may be generating lots of similar processes.

just a thought !

:-) John
Jim Butler
Valued Contributor

Re: sh: The fork function failed. Too many processes already exist.

ps -e | awk '{print $4, $2, $1}' | sort

look over your processes -

if you have a bunch that you want to kill,

kill 'ps -e | grep procname | awk '{print $2}'

Man The Bilge Pumps!
doug hosking
Esteemed Contributor

Re: sh: The fork function failed. Too many processes already exist.

Jim, be careful with that command line. You don't want to try to kill 'ron' and actually kill 'cron' for example.