LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Apache gobbling CPU

[ILUG] Apache gobbling CPU

Niall O Broin niall at linux.ie
Wed Aug 6 09:22:07 IST 2008


I just encountered an odd situation on a webserver where the load had  
become rather high, and top was showing me two apache processes each  
consuming > 45% of CPU. Running strace on one of the processes I saw  
that it was doing the below (and nothing else, or nothing else strace- 
able) in a loop:

open("/etc/hosts", O_RDONLY)            = 55
fcntl64(55, F_GETFD)                    = 0
fcntl64(55, F_SETFD, FD_CLOEXEC)        = 0
fstat64(55, {st_mode=S_IFREG|0644, st_size=300, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,  
0) = 0xb6477000
read(55, "127.0.0.1    localhost       loc"..., 4096) = 300
read(55, "", 4096)                      = 0
close(55)                               = 0
munmap(0xb6477000, 4096)                = 0

So, I killed it whereupon the CPU usage of its partner in crime jumped  
to over 90% and strace revealed it to be engaged in the same  
behaviour, which got it the same treatment, and load is back down to a  
sensible figure.

In all likelihood, this was caused by some piece of PHP gone mad but  
the question is, what, and how to find out? Given such a situation, is  
there any way of mapping a particular apache process to a request?


Niall






More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell