LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-25-2006, 07:47 AM   #1
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Rep: Reputation: 30
Cannot allocate memory bringing web server down - advice?


Hello

One of our servers seems to be going down often. I've looked through the web server's log files, and have noticed that today we had quite a few entries along the following lines:

[Tue Jul 25 11:03:59 2006] [error] [client 127.0.0.1] (12)Cannot allocate memory: couldn't create child process: 12: php5
[Tue Jul 25 11:03:59 2006] [error] [client 127.0.0.1] (12)Cannot allocate memory: couldn't spawn child process: /usr/lib/cgi-bin/php5

(The IP is ok, these are localhost call-backs which are expected from our web app.)

This happens for a while, until:

[Tue Jul 25 11:04:41 2006] [error] [client 127.0.0.1] (12)Cannot allocate memory: poll failed waiting for CGI child

Then we find that the web server is down.

Do you happen to know why such log entries would be occurring? Any suggestions on how we could fix this issue?

Thanks.
 
Old 07-25-2006, 03:37 PM   #2
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Rep: Reputation: 15
Hi,

What is the RLimitMEM value set to in your httpd.conf? Is it there at all?

cg
 
Old 07-25-2006, 05:53 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Also, how much memory and swap does your system have? If it runs out, it's just plain out of luck. I'd also look and see if the user apache runs as has any specific limits with ulimit.
 
Old 07-26-2006, 02:46 AM   #4
neocookie
Member
 
Registered: Apr 2004
Location: Leeds, UK
Distribution: FC1, FC2, Debian
Posts: 308

Original Poster
Rep: Reputation: 30
cg: No, there's no RLimitMEM in there. Should I add it? What's a good setting?

Matir: This is a virtual server hosted on a relatively "large" box. I'm unsure as to the exact limits, but I believe that its around 128mb RAM, 10GB HDD. I'm not sure about swap, as I think thats handled by the super-server.

So this is generally an out-of-memory problem then? Are there any tweaks I can make to apache/php/mysql to reduce memory usage or the length of time they run for before dieing? I've got KeepAlive in apache set to "off" from recommendations.
 
Old 07-26-2006, 04:24 AM   #5
closet geek
Member
 
Registered: Apr 2003
Location: England
Posts: 146

Rep: Reputation: 15
neocookie: I'm afraid I'm not too sure on what people think is a wise number to set for the RLimit in your situation.

cg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Streaming Web Server advice needed Tectron1 Linux - Software 1 06-15-2005 11:51 AM
Cannot allocate memory Terroth Linux - General 13 02-09-2005 05:22 AM
seeking advice on running a web server hirman Linux - Newbie 4 11-25-2004 09:29 AM
allocate more memory? sockknitter Debian 3 11-06-2004 05:23 PM
Security advice for a web server please pembo13 Linux - Security 4 07-01-2004 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration