Re: Troubleshooting Apache Out of Memory Errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jan 4, 2009, at 9:41 PM, Plutocrat wrote:

- Apache/2.2.3 using prefork
- PHP 5.1.6 (cli)

What do you mean when you say 'cli'? Are you using mod_php, or running it as a CGI?

- mysql  Ver 14.12 Distrib 5.0.45
- Joomla 1.5.7 (latest version)
- Wordpress 2.x (latest version)


MaxClients       256

memory_limit = 100M

I've seen Joomla use a lot of memory. I've used it on a Windows server, and have seen the single 100 thread child process balloon to 800Mb and stay there. If you get 256 child processes and have each allocate 100Mb of memory, you end up with 25Gb memory allocated in your 4Gb swapspace: that is just not going to fit.

Note that memory_limit is per script executed. I believe the default is 8Mb: what made you change that?

OK, if you're still with me, thanks for getting this far. So before the Out of Memory, the CPU load is around 70% and the load average is high, but not critical. After the Out of Memory, the entre Swap is full, the load average is insane, and the disk is swapping like crazy. There also seem to be a lot of httpd processes spawned, but not really doing much. At this point the server is inaccessible. Over the next hour or two the swap never really empties, and only returns to normal after a reboot.

I'd look at a couple of things:

1) How does your MySQL server configuration match that Apache configuration? Does
   your httpd ever have problems connecting to MySQL?
2) When you look at your processes in top, does the RSS column for your httpd processes show any disturbing development? How big do the processes get
   in the 4000 connections you allow them?
3) When you filter all the 404 ("File does not exist") out of your error log, are
   you left with any clues?

If I were to take a shot at your problem, I'd look in the direction of a scenario where your child processes get bigger than 8Mb, and something makes child processes hang sufficiently long that the parent has to spawn more children to service requests. Those children then also hang on the same resource, which causes more children to be spawned to serve incoming requests, eventually filling up your memory you'll break down rapidly from there.

S.

--
Sander Temme
sctemme@xxxxxxxxxx
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF



Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux