K
K
Kacblm2016-03-04 15:57:19
Nginx
Kacblm, 2016-03-04 15:57:19

Nginx long switch to upstream backend how to check?

Colleagues, good afternoon!
When load balancing through nginx (upstrem) using only DNS RR, I have the following problem.
On the balancer, through iptables I close all tcp connections to one of the backend servers. And I poke on the open site F5. Switching to the second node does not happen immediately. And according to theory, it should happen after a few unhurried requests. Tell me how to be in this situation and what logs to watch?) I played with the parameters max_fails=3 fail_timeout=5s; the result is similar.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kacblm, 2016-03-04
@Kacblm

I found the answer myself. More precisely, I asked my senior comrade Liksuid.
I emitted the fall of one of the backends using IPTABLES (iptables -A OUTPUT -d 172.20.5.12 -j DROP)
Apparently Nginx has its own polling mechanisms, it is probably waiting for a response from the host. And in this case, there was no answer. And Nginx did not understand what was happening with one of the backends.
You need to register REJECT and there will be happiness =) If someone has a more academic explanation, then I'm ready to listen)

B
borodka_lenina, 2016-04-06
@borodka_lenina

Add the
keepalive 10 parameter to the upstream;
If 10 seconds one of the backs did not answer, then he starts sending everything to another backend

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question