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:
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.
I think the results are not correct because I switch off nginx and
values come correct again. I swich on nginx and I get weird values. That
is why.
You said:
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.
Any tip, clue or url to start investigating about this?
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.
On Thu, Jul 19, 2012 at 11:52:00AM -0400, migue76 wrote:
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.
Any tip, clue or url to start investigating about this?
I would try to calculate something like “cpu seconds per request”
metric and if it doesn’t match previously seen values - start digging
where additional cpu seconds go. Playing with Apache settings
like MaxClients/MaxSpareServers/MinSpareServers might be helpfull,
as well as monitoring various things like system fork rate and so on.
Note though that some difference is normal, e.g. due to the fact
that nginx doesn’t use keepalive to upstream servers by default.
Maxim D.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.