# Drain mode VS MAINT mode

**URL:** <https://discourse.haproxy.org/t/drain-mode-vs-maint-mode/12149>\
**Category:** Help!\
**Created:** [March 26, 2026, 5:04pm UTC](https://discourse.haproxy.org/t/drain-mode-vs-maint-mode/12149 "2026-03-26T17:04:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![romgo](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@romgo](https://discourse.haproxy.org/u/romgo)\
**Post date:** [March 26, 2026, 5:04pm UTC](https://discourse.haproxy.org/t/drain-mode-vs-maint-mode/12149/1 "2026-03-26T17:04:18Z")

</div>

Dear community,

by reading some documentation about the dataplane API I got confused with regards to put out of production gracefully a backend server.

Seems there is two ways to do it :

- disable server, will result in MAINT mode

> **[disable server](https://www.haproxy.com/documentation/haproxy-runtime-api/reference/disable-server/)**
>
> Put a server in maintenance mode.

- set server either DRAIN or MAINT mode

> **[set server](https://www.haproxy.com/documentation/haproxy-runtime-api/reference/set-server/)**
>
> Change a server's properties.

That being said, I understood that using directly `MAINT mode` or `disable server` will result in dropping tcp connections currently active, am I right ?

So the cleanest way to put a backend out of production is to :

- set Drain mode,
- Verify connection is 0
- set the node to Maint

Thank you !

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [March 30, 2026, 4:24pm UTC](https://discourse.haproxy.org/t/drain-mode-vs-maint-mode/12149/2 "2026-03-30T16:24:47Z")

</div>

I don’t think haproxy will ever drop existing connections, unless one of the following is true:

- [shutdown session XY](https://docs.haproxy.org/3.2/management.html#9.3-shutdown%20session) or [shutdown sessions server backend/server](https://docs.haproxy.org/3.2/management.html#9.3-shutdown%20sessions%20server) is manually issued
- [on-marked-down shutdown-sessions](https://docs.haproxy.org/3.2/configuration.html#5.2-on-marked-down) is configured
- [hard-stop-after](https://docs.haproxy.org/3.2/configuration.html#3.1-hard-stop-after) runs out of time during a reload (soft reconfiguration)

The exact difference between maint and drain mode will always depend on your configuration, but generally speaking you should be able to go to maint mode directly, and then figure out how to shutdown existing connections that don’t go away on their own (for example by issuing the shutdown-sessions command).
