Failover Protection

Failover Protection with Traffic Distributor

Traffic Distributor includes a health-check module that regularly verifies backend availability and automatically removes unavailable servers from request routing.

The health-check functionality is enabled by default. Its interval, failure threshold, recovery threshold, timeout, initial backend state, port, and protocol can be adjusted when the default behaviour does not match the application requirements.

Open the NGINX Configuration

1Open the NGINX Config panel

In the Traffic Distributor environment, click the Config button for the NGINX layer.

Navigate through Root > etc > nginx and open:

/etc/nginx/nginx-jelastic.conf
Traffic Distributor NGINX configuration files
Open nginx-jelastic.conf from the Traffic Distributor NGINX configuration panel.

Health-Check Configuration Syntax

Scroll to approximately line 50 and locate the health-check directive inside the upstream common section.

check interval={interval} fall={fail_count} rise={rise_count}
      [timeout={timeout}] [default_down={true/false}]
      [port={port}] [type={type}]
Traffic Distributor failover parameters
The health-check directive inside the upstream common section.
Parameters shown in square brackets are optional. Required values define the check interval and the failure and recovery thresholds.

Health-Check Parameters

ParameterDescription
intervalDelay in milliseconds between two consecutive health-check requests.
fallNumber of consecutive failed checks after which the backend is marked unavailable.
riseNumber of consecutive successful checks after which the backend is marked available again.
timeoutMaximum time in milliseconds that the module waits for a backend response before treating the check as failed.
default_downSets the initial backend state before the required checks complete. true starts it as down; false starts it as up. The documented default is true.
portPort used for the check. A value of 0 uses the default server port for the selected protocol.
typeProtocol used to verify backend availability.

Supported Health-Check Types

  • tcp — opens a TCP socket connection.
  • ssl_hello — sends an SSL Client Hello and expects a Server Hello response.
  • http — sends an HTTP request and parses the response.
  • mysql — connects to a MySQL server and receives its greeting response.
  • ajp — sends an AJP Cping packet and expects a Cpong response.
  • fastcgi — sends a FastCGI request and parses the response.

Default Failover Example

The documented example checks both backends every three seconds and expects a normal HTTP response with status code 200.

  • Each backend is checked every 3 seconds.
  • After 3 consecutive failed checks, the backend is marked down.
  • The unavailable backend is removed from routing.
  • All requests are sent to the remaining environment.
  • After 3 successful checks in a row, the recovered backend is added back automatically.
Traffic continuity: The second backend must be healthy and capable of handling the complete workload when the first backend is excluded.

Apply Changes without Downtime

2Save the configuration

Save the updated nginx-jelastic.conf file.

3Reload Traffic Distributor

Open the Traffic Distributor add-on menu and select Reload configuration.

Reload Traffic Distributor configuration
Apply the updated failover settings through a graceful NGINX reload.

Confirm the action in the pop-up window. The graceful reload applies the new failover settings without restarting the complete server, helping avoid application downtime.

Before production changes, verify the NGINX syntax and confirm that the selected path, port, protocol, timeout, and thresholds match the real backend behaviour.

What’s next?