There are three ways to update the running configuration in HAProxy: by restarting, reloading, or hitless reloading.

  • Restart: The existing HAProxy process is stopped and a new one is started.

  • Reload: A new process is started and the old process is instructed to close its sockets once it is ready. This results in about 100ns where the old process can refuse connections.

  • Hitless reload: The new process reads the sockets from the old process via the socket, so that there are no refused connections.

With reloads or hitless reloads, the old process will keep running until its existing connections are concluded. For keep-alive connections, the next response from it will have a connection; you can close the header to speed that process along. With a restart, existing connections will be interrupted.

The init script currently supports restart and reload, but hitless reloads require the following configuration.

Hitless reloads are available in HAPEE 1.7r1 and later.

Configuring a hitless reload

Before you start, you need to know the locations for the following:

  • HAProxy socket (if using nbproc > 1, you only need a socket for one of the processes)

  • The HAProxy binary (usually /opt/hapee-1.8/sbin/hapee-lb)

If unsure where to find this information:

  • Run ps auxw | grep hapee-lb to display everything (except socket locations).

  • Look for 'stats socket' in the 'global' for socket locations.

Prepare the configuration

  1. In the configuration file's 'global' section at the top, locate the 'stats socket' line similar to the following: (if you do not see it, you must create it)

    stats socket /var/run/1.8/hapee-lb.sock user hapee-lb group hapee mode 660 level admin
  2. Add expose-fd listeners to this line, as follows:

    stats socket /var/run/1.8/hapee-lb.sock user hapee-lb group hapee mode 660 level admin expose-fd listeners
  3. Run a normal reload on HAPEE for a last time, with:

    service hapee-1.8-lb reload

Performing a hitless reload

For versions running systemd

Run service 1.8-lb reload. The master process then appends automatically -x with the socket path to the new worker processes it spawns, if the currently running process has expose-fd listeners in it.

When you add expose-fd listeners for the first time, it will perform a normal reload, as the existing process will not send its FD sockets to the new process.