HAProxy Enterprise Documentation 10.5

TCP

To check a real server's availability by running a TCP handshake, use the following directive:

option tcpcheck [interval <seconds>] [timeout <seconds>] [source <ip>] [port <port>]

This directive takes the following arguments:

interval <seconds> (optional)

Interval between two checks, in seconds (default: 10 seconds)

timeout <seconds> (optional)

Period after which an attempt without a response from the server is considered as failed (default: 3 seconds)

source <ip> (optional)

Source IP to use when performing the check

port <port> (optional)

Forces the destination port (default: real server port, if it exists)

Check the availability of an FTP server

director d_ftp
  # ...
  option tcpcheck port 21 interval 5s timeout 1s
  server ftp1 10.0.0.1 check
  server ftp2 10.0.0.2 check