stream, it always aborts the first server in upstream

itpp2012 nginx-forum at nginx.us
Mon Oct 5 12:20:03 UTC 2015


A strange 'bug' in stream, it always aborts the first server in upstream
eventhough there is nothing wrong with the server.

2015/10/05 12:21:01 [info] 1436#684: *1 client 192.168.xxx.xxx:1994
connected to 0.0.0.0:xxxx
2015/10/05 12:21:01 [info] 1436#684: *1 proxy 192.168.xxx.xxx:1493 connected
to 192.168.xxx.200:xxxx
2015/10/05 12:21:03 [info] 1436#684: *1 client disconnected, bytes from/to
client:334/192600, bytes from/to upstream:192600/334
>>server1 in upstream aborted after 2 seconds
2015/10/05 12:21:04 [info] 1436#684: *3 client 192.168.xxx.xxx:1998
connected to 0.0.0.0:xxxx
2015/10/05 12:21:04 [info] 1436#684: *3 proxy 192.168.xxx.xxx:1494 connected
to 192.168.xxx.200:xxxx
>>server2 (which is the same as server1) connects ok and streams perfect

stream {
  upstream backendst {
# servers are all the same, when using different servers the problem
remains
# when using only one server the logs say the same, abort on first attempt,
after 2 seconds a second attempt works ok
    server 192.168.xxx.200:xxxx;
    server 192.168.xxx.200:xxxx;
  }

  server {
    listen xxxx;
# extremely tight timeout settings, have tested with 10x these values which
made no difference to the issue
    proxy_connect_timeout 10s; # to proxy backend
    proxy_timeout 10s; # to client
    proxy_next_upstream on;
    proxy_next_upstream_timeout 10;
    proxy_next_upstream_tries 2;
    proxy_pass backendst;
  }
}

nb. I am aware it says "client disconnected" but this is not the case, wget,
curl, and a dozen other apps all do and log the same thing. Connecting
directly to upstream servers works fine too on the first try (no reconnect).

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,262006,262006#msg-262006



More information about the nginx mailing list