# How to know if my nginx is in good health?

**URL:** <https://www.ruby-forum.com/t/how-to-know-if-my-nginx-is-in-good-health/224698>\
**Category:** NGINX\
**Created:** [November 22, 2012, 6:51am UTC](https://www.ruby-forum.com/t/how-to-know-if-my-nginx-is-in-good-health/224698 "2012-11-22T06:51:33Z")\
**Posts on this page:** 3\
**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:** [November 22, 2012, 6:51am UTC](https://www.ruby-forum.com/t/how-to-know-if-my-nginx-is-in-good-health/224698/1 "2012-11-22T06:51:33Z")

</div>

Hi,

I am running a nginx on EC2 (m1.small) for SSL termination.

I am using 2 workers on Ubuntu, with latest nginx (stable), the network  
throughput is around _2Mbps_ and system load average is around _2 to 3._

I am wondering if this system is in good health for now,

e.g.

1. what is the queue length (I know nginx can handle a lot of  
concurrent  
request, but I mean before the request is being served, how many of  
them  
need to wait before being served)
2. what is the average queue time for a given request to be served.

I want to know because if my nginx is _cpu bounded_ (e.g. due to SSL), I  
will need to upgrade to a faster instance.

My current nginx status

Active connections: 4076  
server accepts handled requests  
90664283 90664283 104117012  
Reading: 525 Writing: 81 Waiting: 3470

Any idea?

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [November 22, 2012, 6:54am UTC](https://www.ruby-forum.com/t/how-to-know-if-my-nginx-is-in-good-health/224698/2 "2012-11-22T06:54:28Z")

</div>

On Thu, Nov 22, 2012 at 12:51 PM, howard chen [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Active connections: 4076  
> server accepts handled requests  
> 90664283 90664283 104117012  
> Reading: 525 Writing: 81 Waiting: 3470
> 
> Any idea?

why not just

vmstat 1

for few hours and see the cpu usage?

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [November 22, 2012, 4:56pm UTC](https://www.ruby-forum.com/t/how-to-know-if-my-nginx-is-in-good-health/224698/3 "2012-11-22T16:56:10Z")

</div>

Hi,

On Thu, Nov 22, 2012 at 1:53 PM, Edho A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Thu, Nov 22, 2012 at 12:51 PM, howard chen [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:why not just
> 
> vmstat 1
> 
> for few hours and see the cpu usage?

My biggest concern is not CPU load, as it tend to tell you nothing, e.g.  
what is the implication of decreasing CPU from 70% to 60%?

I am more interested in real figures, e.g. length of queue of pending  
connections decrease from 10 to 5, average request time decrease from  
100ms  
to 50ms for example..

Thanks anyway.
