Is it possible for the backend to know that connections to it are being drained so that it could start gracefully closing persistent connections?
The use case is as follows:
- the LB is in TCP mode (loadbalancing SSL connections that have to be end2end)
- the application has an auxiliary HTTP port specifically for LB-side health-checks
- want to gracefully remove one backend server from load-balancing (not affecting any client connections)
- backend app uses persistent connections (http keep-alive)
- Even though LB enters DRAIN mode, persistent connections may never terminate while there is traffic on them.
It looks like one of the potential solutions would be to tell the backend application to start gracefully dropping persistent connections (essentially, start replying ‘Connection: close’).
How can the backend find out that it should end persistent connections?
http-check send-state seems like a good fit, but the only information the backend receives is the operational state (UP/DOWN/NOLB).
Is it possible to get the administrative state (MAINT/DRAIN) in the health-check request header as well?
Thanks in advance