# Weird apache status values with nginx

**URL:** <https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510>\
**Category:** NGINX\
**Created:** [July 17, 2012, 7:28pm UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510 "2012-07-17T19:28:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 17, 2012, 7:28pm UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510/1 "2012-07-17T19:28:35Z")

</div>

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](http://i46.tinypic.com/nbte09.jpg) \<— good

[http://i46.tinypic.com/1jsot5.png](http://i46.tinypic.com/1jsot5.png) \<— bad

Please, look at “cpu usage”: u601?? s261?? cu4368?? However, cpu load is  
correct

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?

Finally, look at cpu load for each vhost (below): 174, 175, 170, etc…

Global cpu load and performance on server is nice. No problem but that  
values prevents me know true values.

Any suggestion? Ideas?

Thank you!

Posted at Nginx Forum:

> **[Weird apache status values with nginx](https://forum.nginx.org/read.php?2,228652,228652#msg-228652)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![migue76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71e660/32.png) [@migue76](https://www.ruby-forum.com/u/migue76)\
**Post date:** [July 19, 2012, 2:08pm UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510/2 "2012-07-19T14:08:00Z")

</div>

Hello!

On Tue, Jul 17, 2012 at 01:28:22PM -0400, migue76 wrote:

> [http://i46.tinypic.com/1jsot5.png](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

---

<div class="post-metadata">

**Author:** ![migue76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71e660/32.png) [@migue76](https://www.ruby-forum.com/u/migue76)\
**Post date:** [July 19, 2012, 5:52pm UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510/3 "2012-07-19T17:52:27Z")

</div>

Thanks for your explanation Maxim.

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.

Thanks! I understand now!

Regards.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,228652,228751#msg-228751](http://forum.nginx.org/read.php?2,228652,228751#msg-228751)

---

<div class="post-metadata">

**Author:** ![migue76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71e660/32.png) [@migue76](https://www.ruby-forum.com/u/migue76)\
**Post date:** [July 20, 2012, 12:52pm UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510/4 "2012-07-20T12:52:35Z")

</div>

Thank you for your help Maxim.

I’ll try to investigate about your suggestions

Thanks for your support.

Posted at Nginx Forum:

> **[Re: Weird apache status values with nginx](https://forum.nginx.org/read.php?2,228652,228783#msg-228783)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![migue76](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71e660/32.png) [@migue76](https://www.ruby-forum.com/u/migue76)\
**Post date:** [July 20, 2012, 11:51am UTC](https://www.ruby-forum.com/t/weird-apache-status-values-with-nginx/221510/5 "2012-07-20T11:51:14Z")

</div>

Hello!

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.
