1

When I run ps aux I get the following process table http://pastebin.com/NJsASBek that shows how much memory is being used by each one of the subprocess. 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 but I have no idea if that belongs to either foo1.domain.com or to foo2.domain.com or to fooX.domain.com etc...

How can I know which is the site (for example the ServerName) of those PID showing?

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

cjc
  • 24,916
  • 3
  • 51
  • 70
quarry32
  • 255
  • 2
  • 11
  • 3
    Describe the problem you're trying to solve; don't ask us how to implement the broken solution you've come up with. – womble Apr 02 '12 at 20:31

2 Answers2

5

A given Apache worker isn't associated with any particular virtual host.

If you want more detailed information on what Apache is doing (including resource usage), you should turn on Apache's status pages and look at the extended status information:

http://articles.slicehost.com/2010/3/26/enabling-and-using-apache-s-mod_status-on-ubuntu

For example, this is what the Apache Foundation's status page looks like:

http://www.apache.org/server-status

cjc
  • 24,916
  • 3
  • 51
  • 70
1

Use:

WSGIDaemonProcess foo display-name=%{GROUP}

and when you use 'ps' the mod_wsgi daemon process group processes will show as '(wsgi:foo)'.

Where you have multiple host aliases mapping to same daemon process group however, you will not be able to distinguish how much each is contributing as all handled by same process.

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19