Geoffrey Young wrote:

Alex Greg wrote:

Hi,


[...]

[Thu Sep 30 09:44:43 2004] [error] (12)Cannot allocate memory: fork:
Unable to fork new process


there is lots of documentation around about how to tune your httpd processes
so that they don't kill your box.  see, for example

  http://perl.apache.org/docs/1.0/guide/performance.html

as well as

  chapters 11 and 12 in practical mod_perl
  chapter 9 in the mod_perl developer's cookbook

Hi Geoff,


Thanks for your response. Sorry I wasn't clear; the httpd processes don't actually kill the server, they just slow Apache right down to the point at which it doesn't respond to requests any more. I am still able to get onto the box and kill the processes etc. without having to do a hard reboot or anything. My question is what's causing Apache to get into the state where it can't fork any more shells from Perl.


This is because a shell call to date ($date = `date`;) is failing - this
is most likely what's causing the failure to fork we see above.


if you want to avoid that shell call try POSIX::strftime() instead.


We have quite a lot of calls via backticks throughout our code - and not just for things like date that are trivially replaceable. Would you recommend replacing these as far as possible?

but I
suspect that the httpd failure isn't caused by calling out to shell, but
rather that the shell call failure is a symptom of the real problem.


Agreed. I will have a thorough read of the performance guide. Can you suggest what the real problem might be, or what might be causing it?



Thanks very much,


-- Alex

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to