load balancing - HAproxy passive health checking -


i'm new haproxy , load balancing. want see happens when backend host turned off while proxy running.

the problem is, if turn off 1 of backends , refresh browser page immediateltly exposes 503 error user. after next page load, no longer gets error since presumably backend has been removed pool.

as test have set 2 backend flask apps , configured haproxy balance them so:

backend app     mode    http     balanace    roundrobin     server app1 127.0.0.1:5001 check     server app2 127.0.0.1:5002 check 

my understanding according this: https://www.haproxy.com/doc/aloha/7.0/haproxy/healthchecks.html#check-parameters

is every 2 seconds backend hosts pingged see if up. removed pool if down. 5xx error happens between time kill backend , 2 seconds.

i think there way around 5xx error having haproxy perform little logic such if request frontend fails, remove failed backend pool , switch , make request. way user never see failure.

is there way this, or should try else user not error?

by default haproxy retry 3 times (retries) 1s intervals the same backend. in order allow take backend should set option redispatch.

also consider (carefully, can hamrfull):

note: haproxy retries on connection errors (e.g. econnnrefused in case), not resend/resubmit request/data.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -