# Knowing administrative state (MAINT/DRAIN/...) backend-side

**URL:** <https://discourse.haproxy.org/t/knowing-administrative-state-maint-drain-backend-side/528>\
**Category:** Help!\
**Created:** [July 28, 2016, 3:10pm UTC](https://discourse.haproxy.org/t/knowing-administrative-state-maint-drain-backend-side/528 "2016-07-28T15:10:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbronk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/mbronk/32/103_2.png) [@mbronk](https://discourse.haproxy.org/u/mbronk)\
**Post date:** [July 28, 2016, 3:10pm UTC](https://discourse.haproxy.org/t/knowing-administrative-state-maint-drain-backend-side/528/1 "2016-07-28T15:10:58Z")

</div>

Hi,  
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)

The problem:

- 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_’).

Question being:  
How can the backend find out that it should end persistent connections?  
**[http-check send-state](https://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4-http-check%20send-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

---

<div class="post-metadata">

**Author:** ![mbronk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/mbronk/32/103_2.png) [@mbronk](https://discourse.haproxy.org/u/mbronk)\
**Post date:** [August 23, 2016, 12:26pm UTC](https://discourse.haproxy.org/t/knowing-administrative-state-maint-drain-backend-side/528/2 "2016-08-23T12:26:07Z")

</div>

Hi, Any ideas?  
I.e. if using http-check is not the way to go, how do you typically tackle graceful node detach when running in L4 and the app uses persistent connections?

Or - what would it take to extend **http-check send-state** to include extra info?

Thanks!
