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 have installed the apachelog program on my ubuntu system. I have several virtual hosts that point to the same log file, so when I run the following, I should see all requests from the multiple sites:

$ apachetop -T 300 -f /var/log/apache2/other_vhosts_access.log

That should show all requests coming in starting now for the next 5 minutes. So I test it with multiple sites, and indeed it reports them:

last hit: 20:56:14         atop runtime:  0 days, 00:02:50             20:56:24
All:           10 reqs (   0.1/sec)       7443.0B (  103.4B/sec)     744.3B/req
2xx:       3 (30.0%) 3xx:       7 (70.0%) 4xx:     0 ( 0.0%) 5xx:     0 ( 0.0%)
R (170s):      10 reqs (   0.1/sec)       7443.0B (   43.8B/sec)     744.3B/req
2xx:       3 (30.0%) 3xx:       7 (70.0%) 4xx:     0 ( 0.0%) 5xx:     0 ( 0.0%)

 REQS REQ/S    KB KB/S URL
    3  0.04   6.0  0.1*/
    2  0.03   0.2  0.0 *
    1  0.01   0.2  0.0 /wp-includes/js/comment-reply.js
    1  0.01   0.2  0.0 /wp-content/themes/gd-theme/scripts/cycle.js
    1  0.01   0.2  0.0 /wp-content/themes/gd-theme/scripts/api.js
    1  0.01   0.2  0.0 /wp-includes/js/jquery/jquery.js
    1  0.06   0.2  0.0 /users/sign_in

One was from a wordpress site and another from ruby on rails site. Apache says there were 7 requests coming in. Maybe there were 7 http requests coming in (I highly doubt it because that ruby on rails site has several js and images to load), but actually there were only 2 tcp connections made and only two apache child processes should have been spawned, since I am using KeepAlive. Something definitely doesn't seem right with the output it is showing.

What may I be missing here?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

apachetop parses the access log of Apache.
Each requests gets individually written to this log regardless of whether it was requested in a single KeepAlive session or multiple TCP sessions.

apachetop cannot know anything about how many TCP connections have been made.
That access log also does not contain any information about Apache childs/threads, so it also cannot report those.

All it shows you is how many resources have been requested.

share|improve this answer
    
Well then this doesn't accomplish what I need. I need a program that tells me how many apache processes are active and how much private memory they are using collectively. –  JohnMerlino May 4 at 21:45
    
For that apachetop is not the proper tool. You might want to take a look at mod_status (httpd.apache.org/docs/2.2/mod/mod_status.html). –  faker May 4 at 21:47
    
the mod_status module with ExtendedStatus enabled does provide a lot of useful information. Unfortunately that doesn't give private memory usage either. –  JohnMerlino May 5 at 3:07

Many browsers will open up multiple connections to load resources like javascript. I see four of the requests are for java script. These connection may be closed quickly.

share|improve this answer

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.