Configuring HAProxy Load Balancer

In the portal, the HA Proxy type load balancer is configured through the controllers page in the load balancer modal.

To get there:

  1. Environments from the main, left-hand navigation.
  2. Select the environment from the first column.
  3. Scroll down to the services tile, and click on the manage tab of the load balancer.
  4. Select the Controllers page.

services section

On the controllers page, the toggle for Enable Custom Config must be enabled to make changes to the load balancer config.

Configuring The Load Balancer - Ingress

The load balancer is configurable directly from the interface. You are able to adjust modes, create specific port configurations, and override timeout settings with ease.

  1. Click the Environments link in the navigation menu to the left.
  2. Select the environment who's load balancer you wish to configure from the list.
  3. Click the "Load Balancer" tab at the top of the page.
  4. Enable "Custom Config" by toggling the switch in the upper right hand corner of the form. This will allow you to override the Cycle defaults with custom settings. Disabling custom config after updating the load balancer will cause it to revert back to Cycle's default config.

Default Config

The load balancer comes with a "default config", which is how it treats all ports (that aren't 80 or customized otherwise). These settings will be applied to all ports that aren't explicitly defined in this configuration. The mode cannot be changed for the default config.

Frontend Options

Frontend configuration options are related to how inbound traffic is treated.

FieldDescription
Mode (TCP)Traffic is forwarded by port without any parsing or additional manipulation.
Mode (HTTP)Traffic is treated as web traffic. If a LINKED record is configured for a container exposing this port, the domain will be parsed and forwarded to the proper container, allowing multiple services to run on port 80 in the same environment.
Max ConnectionsThe number of simultaneous connections that can be processed at a time.
Client TimeoutThe number of seconds the load balancer will wait for a response from a client before disconnecting.
Client Finish TimeoutThe number of milliseconds the load balancer will wait for a client to send data when one direction is already closed.
HTTP Keep Alive [HTTP mode only]The number of milliseconds the load balancer will wait for a new HTTP request to start coming after a response was sent.
HTTP Request Timeout [HTTP mode only]The number of milliseconds the load balancer will wait for a complete HTTP request.

Backend Options

Backend configuration options are related to how the load balancer handles and routes connections

FieldDescription
BalanceHow connections are balanced across your container instances.
Server Request TimeoutThe number of seconds the load balancer will wait for a response from the container instance. See the HAProxy Docs for more information.
Server Finish TimeoutThe number of milliseconds the load balancer will wait for the server to send data when one direction is already closed. See the HAProxy Docs for more information.
Connection TimeoutThe number of milliseconds the load balancer will wait for a successful connection to a container instance. See the HAProxy Docs for more information.
Queue TimeoutThe number of milliseconds the load balancer will hold connections in a queue when the maximum number of connections has been reached. See the HAProxy Docs for more information.
Tunnel TimeoutThe number of milliseconds the load balancer will allow for inactivity on a bidirectional tunnel. See the HAProxy Docs for more information.

Balance Options

FieldDescription
Round RobinEach container instance is used in turns.
Static Round RobinEach container instance is used in turns, but is faster than Round Robin at the expense of being less dynamic.
Least ConnectionRoutes traffic to the instance with the least number of active connections.
FirstRoutes traffic to the first available instance.
SourceThe same client IP always reaches the same container instance as long as no instance goes down or up.