Identifying apache process usage

When apache is running with php as an apache module rather than as a CGI, all processes will run as the apache user.  This makes it a little tricky on a busy multi-site box to identify which sites are using resources and keeping sessions open.  This little command will identify the working directory that the php (or other) script is running from, to hopefully identify which site/directory is causing grief:

for process in $(ps auxf | grep httpd | awk '{print $2}'); do ls -l /proc/$process/cwd; done

You can leave a response, or trackback from your own site.

Leave a Reply