Layer 4 (LVS)

Health checks

The LB Layer4 tab supports the following types of server health checks.

ARP health checks Jump to heading

When load balancing UDP-based services, you can health check your servers by using the Address Resolution Protocol (ARP) to check whether a server with a given IP address exists on the network.

When you set up ARP health checks, HAProxy ALOHA regularly broadcasts an ARP request to all devices on the network to verify that a server with a given IP address exists. If a matching server does not reply, the health check fails.

  1. Select the LB Layer4 tab.

  2. Update your configuration in the following ways:

    • Add a check argument to each server line for which you would like to enable health checking.
    • Add option arpcheck in the same section.
    • Add the check directive to the section to configure other options.
    haproxy
    director syslog_servers 10.0.0.9:514 UDP
    balance roundrobin # load balancing algorithm
    mode gateway # forwarding mode
    option arpcheck
    check interval 5s timeout 1s # advanced check parameters
    server syslog1 10.0.0.1:514 check
    server syslog2 10.0.0.2:514 check
    haproxy
    director syslog_servers 10.0.0.9:514 UDP
    balance roundrobin # load balancing algorithm
    mode gateway # forwarding mode
    option arpcheck
    check interval 5s timeout 1s # advanced check parameters
    server syslog1 10.0.0.1:514 check
    server syslog2 10.0.0.2:514 check

    The option arpcheck directive uses the following syntax:

    text
    option arpcheck [iface <name>]
    text
    option arpcheck [iface <name>]
    Argument Description
    iface <name> (optional) Network interface to use when sending the ARP request.

    The check directive uses the following syntax:

    text
    check { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>]
    [rise <count>] [fall <count>] [inhibit] }
    text
    check { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>]
    [rise <count>] [fall <count>] [inhibit] }
    Option Description
    timeout <seconds> Period after which an attempt without a response from the server is considered as failed (default: half of interval)
    interval <seconds> Interval between two checks, in seconds (default: 10 seconds)
    source <ip> Source IP to use when performing the check
    port <port> Forces the destination port (default: real server port, if it exists)
    rise <count> A server will be considered as operational after <count> consecutive successful health checks. The default is 1.
    fall <count A server will be considered as dead after <count> consecutive unsuccessful health checks. The default is 1.
    inhibit If a server is down, its weight is passed to 0 but not deleted. Established connection are not broken but new connections are dispatched on the other servers.
  3. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

ICMP health checks Jump to heading

When load balancing UDP-based services via the LB Layer4 tab, you can health check your servers by pinging them with the Internet Control Message Protocol (ICMP) to see if they’re up. An ICMP ping sends an echo request packet to the server and then waits for a reply.

When you set up ICMP health checks, HAProxy ALOHA regularly tries to send the server a ping request. If the server does not return a response, the health check fails.

  1. Select the LB Layer4 tab.

  2. Update your configuration in the following ways:

    • Add a check argument to each server line for which you would like to enable health checking.
    • Add option icmpcheck in the same section. It take no arguments.
    • Add the check directive to the section to configure other options.
    haproxy
    director syslog_servers 10.0.0.9:514 UDP
    balance roundrobin # load balancing algorithm
    mode gateway # forwarding mode
    option icmpcheck
    check interval 5s timeout 1s # advanced check parameters
    server syslog1 10.0.0.1:514 check
    server syslog2 10.0.0.2:514 check
    haproxy
    director syslog_servers 10.0.0.9:514 UDP
    balance roundrobin # load balancing algorithm
    mode gateway # forwarding mode
    option icmpcheck
    check interval 5s timeout 1s # advanced check parameters
    server syslog1 10.0.0.1:514 check
    server syslog2 10.0.0.2:514 check

    The check directive uses the following syntax:

    text
    check { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>]
    [rise <count>] [fall <count>] [inhibit] }
    text
    check { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>]
    [rise <count>] [fall <count>] [inhibit] }
    Option Description
    timeout <seconds> Period after which an attempt without a response from the server is considered as failed (default: half of interval)
    interval <seconds> Interval between two checks, in seconds (default: 10 seconds)
    source <ip> Source IP to use when performing the check
    port <port> Forces the destination port (default: real server port, if it exists)
    rise <count> A server will be considered as operational after <count> consecutive successful health checks. The default is 1.
    fall <count A server will be considered as dead after <count> consecutive unsuccessful health checks. The default is 1.
    inhibit If a server is down, its weight is passed to 0 but not deleted. Established connection are not broken but new connections are dispatched on the other servers.
  3. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

Do you have any suggestions on how we can improve the content of this page?