Weird apache status values with nginx
Maxim Dounin
mdounin at mdounin.ru
Thu Jul 19 12:07:21 UTC 2012
Hello!
On Tue, Jul 17, 2012 at 01:28:22PM -0400, migue76 wrote:
> Hello.
>
> Since I have installed nginx on our dedicated server I'm having some odd
> issue. The "cpu usage" and "requests currently being processed" are not
> correct on apache-status
>
> A couple of image to see ir clearly. Images from same server at same
> time, same accounts and similar traffic:
>
> http://i46.tinypic.com/nbte09.jpg <--- good
>
> http://i46.tinypic.com/1jsot5.png <--- bad
>
> Please, look at "cpu usage": u601?? s261?? cu4368?? However, cpu load is
> correct
Why do you think it isn't correct? Two days at 3% cpu usage is
something about 5000 cpu seconds.
Keeping in mind that in Apache server status's "CPU load" is just
(u + s + cu + cs ) / uptime, it's highly unlikely that cpu usage
stats would be incorrect while cpu load reported is correct.
The fact that Apache's cpu usage is different from what you have
without nginx might have many reasons. Possible ones are ranging
from incorrect Apache configuration which causes neeedless process
startup/shutdown (which now happens more often due to low worker
process utilization) to just a simple fact that your system
handles more requests now (and consumes more CPU as a result) due
to no longer being limited by some other resource.
> Look at "requests currently being processed": 4 request only? More than
> 300 websites at high traffic time and only 4 request? How is it
> possible?
This is normal, as working with slow clients is offloaded to nginx
now. Apache processes are no longer busy waiting for a client
to sent rest of a request or read another part of a response.
[...]
Maxim Dunin
More information about the nginx
mailing list