Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Ubuntu server and when I run ps aux I get the following process table http://pastebin.com/NJsASBek as we can see apache proceess are shown like this:

www-data 26487 0.0 0.9 245476 14920 ? Sl 17:32 0:00 /usr/sbin/apache2 -k start

Where 2687 is the PID. How can I know wich of my enabled sites belong that process?

This is how my apache sites are defined http://pastebin.com/mcew79sH of course I am willing to edit my apache sites if needed.

share|improve this question
    
As Kyle notes, the apache processes can be serving any virtual host defined your configuration. What are you actually trying to figure out? –  cjc Apr 2 '12 at 18:20
    
Basically I want to know which sites (lets say the ServerName) are consuming more memory, and which consume less. –  quarry32 Apr 2 '12 at 18:40

1 Answer 1

up vote 6 down vote accepted

The default MPM is prefork, which creates (as you've seen) a pre-forked Apache process that is waiting for a connection to serve a request. It does not fire off different processes for different VirtualHost declarations, so any given process could serve any of your sites.

As processes are restarted after a configurable number of requests have been served (or an idle timer passes, and the forks are cleaned up), it's possible that any given process has served pages from multiple VirtualHosts.

share|improve this answer
    
So... how can I know which sites are consuming more memory at a specific moment? –  quarry32 Apr 2 '12 at 18:42
2  
Maybe you should change the title/question or start a new one for that since the current question has been answered. –  Safado Apr 2 '12 at 18:53
    
I have created a new one serverfault.com/questions/376054/… thanks –  quarry32 Apr 2 '12 at 20:06
1  
This answer ignores the fact that they are using mod_wsgi and specifically mod_wsgi daemon mode with the WSGI application delegated to that separate set of processes. More specific answer which deals with that in duplicate question. –  Graham Dumpleton Apr 2 '12 at 21:51
    
+1'd on your post. I'm not familiar with WSGI, clearly :-) –  Kyle Smith Apr 2 '12 at 22:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.