fork: Resource temporarily unavailable
Encountered after installing Django onto shared host, when logging in to a secure shell on the host.
fork: Resource temporarily unavailable
Encountered after installing Django onto shared host, when logging in to a secure shell on the host.
Simon Tite 7:27 am on November 28, 2009
This error is due to having hit a limit on the number of processes you are allowed to run. In the case of shared hosting, this limit is set by your provider, and you probably won’t have any opportunity to change it. When you get this error, then you won’t be able to run any shell commands at all (well, hardly any as I’ll explain…), which makes it quite difficult to fix the problem.
The only command I could run was “exec command” which rather than spawning a sub-process of your shell, replaces your shell with the command. When the command ends, there is no shell to return to, so you are logged off the system. My answer to the problem was:
1. Make sure Putty (or whatever program you are using to log into the remote host) is configured so that it won’t terminate when the connection is dropped.
2. Log in to the shell and type
exec ps -eaf– this will display a list of processes and then terminate the session, but you should still be able to see the result of the command.3. Make a note of the process id (pid) of each process which has your login name.
4. Open up a new terminal session, and enter
exec kill -9 pid1 pid2 .....Once again you will be disconnected.
5. Log in again, it should all work ok now!
But of course, the problem may come back again, and you really didn’t want it to happen in the first place. There may be many different ways to cause this problem, but in my case it was making a bad change to a more-or-less working Django system. The solution was in the script dispatch.fcgi, which is a script for fastcgi. The well behaved Python/Django version looks like this:
It was the last three lines above which did the trick. (Of course, this is an example only, you should change the python path, and ‘myproj’ to values appropriate for your configuration.)
And if you are getting this error with any other language/framework configuration, then it might be worth checking your dispatch.fcgi script.