Bug Report: error_page causes hot looping under heavy load

Sparsh Gupta sparshgupta at gmail.com
Fri Mar 30 13:36:17 UTC 2012


Upon further debugging, the possible issue is at the following line:

src/http/ngx_http_upstream_round_robin.c:433
for ( ;; ) {
               rrp->current = ngx_http_upstream_get_peer(rrp->peers);

               ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
                              "get rr peer, current: %ui %i",
                              rrp->current,

rrp->peers->peer[rrp->current].current_weight);

               n = rrp->current / (8 * sizeof(uintptr_t));
               m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t));



The pc->tries is a ridiculously large number, which causes looping. Here is
the configuration used to reproduce the error:

worker_processes 1;
worker_rlimit_nofile 32768;
error_log /var/log/nginx/error.log warn;
events { worker_connections  16384; use epoll; }

http {
    access_log  off;

    upstream a {
            server 10.56.140.8 backup;
            server 10.56.140.2 backup;
            server 10.56.140.4 backup;
            server 10.56.140.6 backup;
    }

    upstream b {
            server 10.56.140.16 max_fails=100 fail_timeout=5s;
            server 10.56.140.8 backup;
            server 10.56.140.2 backup;
            server 10.56.140.4 backup;
            server 10.56.140.6 backup;
    }

    server {
        listen 80;

        location = /j.php {
            include /etc/nginx/proxy.conf; #with some timeout variables
which are not relevant here I think
            proxy_pass http://b;
            error_page 403 404 500 502 503 504 = @fallback;
        }

        location @fallback {
                proxy_pass http://a;
        }
   }
}


Sparsh Gupta


On 30 March 2012 18:23, Sparsh Gupta <sparshgupta at gmail.com> wrote:

> I compiled a stable release 1.0.14 with no 3rd party modules and under
> heavy load, gdb is showing hot looping around when error_page directive
> is used. The CPU (all 8 cores) reaches 100% usage and the server stops
> responding to further requests
>
> I am happy to share my configurations but its a very simple arrangement
> with varnish server being the backend for proxy_pass. I am using
> apache-benchmark to test it.
>
> Thanks
> Sparsh Gupta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120330/fa4a5bb0/attachment-0001.html>


More information about the nginx mailing list