Opened 13 years ago

Closed 13 years ago

#142 closed defect (duplicate)

infinite loop until server fails in upstream module with round robin

Reported by: unixant@… Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version: 1.1.x
Keywords: round robin infinite loop Cc:
uname -a: Linux localhost.localdomain 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux
nginx -V: nginx version: nginx/1.0.12
built by gcc 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
configure arguments: --with-debug --add-module=addon/jstatus --prefix=output

Description

I use nginx as a load balancing for backend web server.
if this upstream has n servers,and m backup servers,and the n servers are not available(Connection refused),round robin will try n*max_fails times to connect to the n servers。but if there is no backup servers,round robin only try n times to the n servers.
such as:

upstream bdbk {

#no program listen on 8081,8082

server 127.0.0.1:8081 max_fails=3 fail_timeout=10s;
server 127.0.0.1:8082 max_fails=3 fail_timeout=10s;

server 127.0.0.1:8083 max_fails=3 fail_timeout=10s backup;
server 127.0.0.1:8084 max_fails=3 fail_timeout=10s backup;

}

if i make a request,upstream try 6(n*max_fails) to connect to 8081 8082 , then round robin try to connect to backup server.

if there is no backup servers。nginx only try 2(n) connect to 8081 8082。


Attachments (5)

nginx.conf (934 bytes ) - added by unixant@… 13 years ago.
debug.log (16.2 KB ) - added by unixant@… 13 years ago.
error.log (95 bytes ) - added by unixant@… 13 years ago.
upstreams.list (9.1 KB ) - added by unixant@… 13 years ago.
access.log (219 bytes ) - added by unixant@… 13 years ago.

Download all attachments as: .zip

Change History (6)

by unixant@…, 13 years ago

Attachment: nginx.conf added

by unixant@…, 13 years ago

Attachment: debug.log added

by unixant@…, 13 years ago

Attachment: error.log added

by unixant@…, 13 years ago

Attachment: upstreams.list added

by unixant@…, 13 years ago

Attachment: access.log added

comment:1 by Maxim Dounin, 13 years ago

Resolution: duplicate
Status: newclosed

This a variation of #47.

Note: See TracTickets for help on using tickets.