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.

apache server-status ( mod_status ) shows very low CPU usage even though I'm seeing more than 90% in top output.

Shown in server-status page:

CPU Usage: u92.17 s14.87 cu0 cs0 - .0178% CPU load

From top output:

1187 apache    20   0  439m 204m 6000 S 23.2  6.8   0:24.52 /usr/sbin/httpd

Why does this happens ? Cant we use the server-status page to check the apache CPU usage ?

( top output shown is not full, as it has lot of http process running and has many CPU ... Even though it crosses a cumulative of 300% it still shows 0.224% in server-status page ! )

Kindly note It is not the same as like this confusing result on Apache server status results

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Two things which may help you understand what you're seeing:

  1. The 0.0178% load from server-status is the average CPU load since Apache was started. It simply won't pick up spikes in CPU usage like what you seem to be seeing in top. From your numbers I would guess Apache was started roughly 7 days ago ( (92.17+14.87)/0.0178*100/86400=6.96).
  2. There will likely be multiple "http" processes listed in top, at least in prefork mode (unsure about worker mode). One of these will be the "parent" process and the rest are all its children serving requests as needed. Some children may have more CPU/memory usage than others.

The CPU usage from server-status is useful as an average guide to how much CPU Apache is using but mostly useless for recognizing load spikes of which top is much more useful.

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.