HAProxy health checks

  • Why is it that the only HAProxy back-end health check that works is the HTTP one?

    I've spent AGES trying to configure another loadbalancer for the SMTP/S service on a pair of spamfilters and no matter what I do I can't get HAProxy to see the services as UP.  The only way I can get the loadbalancer to work is to turn OFF the health checks (which is not exactly an ideal scenario).

    Any ideas?

  • Hi Pentangle,

    The 'Basic' healthcheck should work, its better than nothing, but only checks for a open tcp port..

    As for smtp healthcheck, what happens if your run "telnet serverip 25"? It should show some 2xx code.


  • Also what does the stats page show when you hover over the lastchk result?

  • Hi PiBa,

    Sorry for the delay.

    Thanks for mentioning the basic health check - i'd totally missed that one out when trying the checks that should have been relevant.  The basic one passes, so it's better than "none"!

    As regards the telnet emailserverip 25, it comes back with a 220 code.

    However, if I try the HELO or EHLO check I get "Socket Error: Connection reset by peer".


  • Hi Mike,

    Ok so i suppose lastchk result on stats page also shows something similar to connection closed or something..?

    Together with the basic check you might try and configure something like this in the advanced settings:

    option tcp-check
    tcp-check expect string 220

    Im not sure if that will work.. Maybe you could try a few variations with it.. See the docs here:
    http://cbonte.github.io/haproxy-dconv/snapshot/configuration-1.6.html#4.2-tcp-check expect

    Regards PiBa-NL

Log in to reply