Counter on backends

Igor Sysoev is at
Thu Sep 13 11:18:39 MSD 2007

On Thu, Sep 13, 2007 at 08:23:21AM +0200, Malte Sussdorff wrote:

> Maybe this has been asked before, but I could not find it.
> Is there a way to count the number of successful requests against an  
> upstream versus the unsuccessful ones?
> My definition for unsuccessful is:
>         error_page   500 502 503 504  /500.html;
>         location = /500.html {
>             root   /web;
>             access_log logs/pi-error.access.log main;
>         }
> I was thinking about counting the number of lines of the main  
> access_log and the error_log once per minute and compare it to the  
> minute before, using the delta as the number of requests per minute  
> and then provide a ratio which proportion of requests failed. But  
> maybe there is a counter in NGINX as well which I could just query  
> and use.
> For seeing times when the site is really busy I could always use  
> awstats on the error access log to show me the busy times, but then I  
> am unsure if my upstream is on strike or we actually have a ton of  
> requests.

No, currently no such counter in nginx.
Using this error log will shows correct error number unless you use several
servers in one upstream.

Igor Sysoev

More information about the nginx mailing list