Maxim Dounin
July 11, 2021 09:30PM
Hello!

On Fri, Jul 09, 2021 at 09:13:37AM -0400, Oleg Pisklov wrote:

[...]

> Then a strange thing happens. I expect that new websocket connections will
> be distributed evenly among two backends. But most of them land on backend1,
> as if backend2 is still disabled. Sometimes there is one client that
> connects to backend2, but it's the only one.
> Further attempts to close connections on server side show the same picture.
> I found that setting max_fails=0 solves the problem with distribution.
>
> Is this correct behavior? If so, how to assure proper distribution of
> websocket connection while using max_fails in such scenarios? Is there any
> documentation for it?

Quoting nginx 1.1.6 changes:

*) Change: if a server in an upstream failed, only one request will be
sent to it after fail_timeout; the server will be considered alive if
it will successfully respond to the request.

That is, only one request (a websocket connection in your case)
after fail_timeout to the failed backend is an expected behaviour.
Once this connection is successfully closed, nginx will mark this
backend as working properly and will start balancing new
connections to the backend.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Upstream get stuck in disabled state for websocket load balancing

Oleg Pisklov July 09, 2021 09:13AM

Re: Upstream get stuck in disabled state for websocket load balancing

Maxim Dounin July 11, 2021 09:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 251
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready