# Announcing the upstream status module

**URL:** <https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811>\
**Category:** NGINX\
**Created:** [April 12, 2010, 6:49pm UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811 "2010-04-12T18:49:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 12, 2010, 6:49pm UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/1 "2010-04-12T18:49:45Z")

</div>

This module provides a handler called upstream\_status that can be used  
as follows:

location /foo {  
upstream\_status;  
}

It reports all the upstream blocks configured for this server. For  
upstreams managed using the round robin (default upstream), it lists all  
the backends configured in a block and indicates the current status  
(up/down)

> **[GitHub - anomalizer/ngx\_upstream\_status: nginx upstream server status page](https://github.com/anomalizer/ngx_upstream_status)**
>
> nginx upstream server status page. Contribute to anomalizer/ngx\_upstream\_status development by creating an account on GitHub.

Improvements are welcome.

---

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 12, 2010, 8:25pm UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/2 "2010-04-12T20:25:46Z")

</div>

Hello!

On Mon, Apr 12, 2010 at 10:18:33PM +0530, Arvind Jayaprakash wrote:

> the backends configured in a block and indicates the current status  
> (up/down)
> 
> [GitHub - anomalizer/ngx\_upstream\_status: nginx upstream server status page · GitHub](http://github.com/anomalizer/ngx_upstream_status)
> 
> Improvements are welcome.

Most important improvement is to document that it actually shows  
configuration and status of upstreams in one particular worker  
process which status request happened to hit.

And, uhm, number of allocs you use to produce simple answer is  
really outstanding. 😉

Maxim D.

---

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 13, 2010, 4:12am UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/3 "2010-04-13T04:12:59Z")

</div>

Maxim D. at 2010-4-13 2:25 wrote:

> > }  
> > Improvements are welcome.
> 
> Most important improvement is to document that it actually shows  
> configuration and status of upstreams in one particular worker  
> process which status request happened to hit.

The only method of showing all the status is using the shared memory,  
but is it worth of that?

> 

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 13, 2010, 7:57pm UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/4 "2010-04-13T19:57:16Z")

</div>

On Apr 12, Maxim D. wrote:

> > 
> 
> Most important improvement is to document that it actually shows  
> configuration and status of upstreams in one particular worker  
> process which status request happened to hit.

Done. I did not realize this until pointed it out but it now seems  
obvious.

> And, uhm, number of allocs you use to produce simple answer is  
> really outstanding. 😉

I completely hated it during the development. If there is an equivalent  
of asprinf() in the nginx API, or a better way, do let me know.

---

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 13, 2010, 11:31am UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/5 "2010-04-13T11:31:23Z")

</div>

Hello!

On Tue, Apr 13, 2010 at 10:12:12AM +0800, Weibin Y. wrote:

> > > }  
> > > Improvements are welcome.
> > 
> > Most important improvement is to document that it actually shows  
> > configuration and status of upstreams in one particular worker  
> > process which status request happened to hit.
> 
> The only method of showing all the status is using the shared  
> memory, but is it worth of that?

I’m not suggesting to re-implement how upstreams are stored in  
nginx. I’m suggesting to document what this particular module  
shows.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Arvind\_Jayaprakash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/fbc32d/32.png) [@Arvind\_Jayaprakash](https://www.ruby-forum.com/u/Arvind_Jayaprakash)\
**Post date:** [April 13, 2010, 10:27pm UTC](https://www.ruby-forum.com/t/announcing-the-upstream-status-module/186811/6 "2010-04-13T22:27:07Z")

</div>

Hello!

On Tue, Apr 13, 2010 at 11:26:04PM +0530, Arvind Jayaprakash wrote:

> > > }  
> > > Improvements are welcome.
> 
> I completely hated it during the development. If there is an equivalent  
> of asprinf() in the nginx API, or a better way, do let me know.

Usual aproach is to count needed buffer size, allocate buffer, and  
then print. See stub status module for an example.

Maxim D.
