Counter on backends

Malte Sussdorff sussdorff at
Thu Sep 13 10:23:21 MSD 2007

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  

More information about the nginx mailing list