Load Balancer Overview

Plans and Pricing

Load Balancers cost $20/month. There is no additional cost to use Let’s Encrypt with Load Balancers.

There are no bandwidth charges for Load Balancers because they are bandwidth neutral. In other words, Load Balancers themselves don’t change the amount of data transferred by Droplets. Bandwidth costs are based on the data transfer of the Droplets included in the backend of the Load Balancer, taking into consideration their own transfer limits.

Regional Availability

Load Balancers and Let’s Encrypt certificate support are both available in every region.

The Droplets you choose for your backend pool must be in the same region as your Load Balancer.

Features

High Availability

A DigitalOcean Load Balancer monitors backend Droplets to ensure that each service is operating healthy. Users can define health check endpoints and set the parameters around what constitutes a healthy response. The Load Balancer will automatically remove machines from rotation that fail health checks until those health checks indicate that service has been restored.

Redundant Load Balancer

DigitalOcean Load Balancers are configured with automatic failover in order to maintain availability even when failures occur at the balancing layer. Internally, the active balancing component is monitored and fails over to a standby if necessary, meaning your Load Balancer is never a single point of failure. To achieve the same outcome and avoid a single point of failure using Droplets, it would take at least two Droplets and a Floating IP.

Tags

There are two different ways to define backend Droplets for a Load Balancer:

  • By name, which lets you add individual Droplets to a Load Balancers using the Control Panel or API.
  • With a tag, which Load Balancers evaluate at runtime.

Tags are custom labels you can apply to Droplets. If you use a tag to define the backend Droplets for your Load Balancer, it will automatically adjust the routing whenever you you add or remove that tag from a Droplet.

Backend Droplet Connections

The Load Balancer will connect to Droplets over the private network if it is enabled on the Droplets in question when they are added to the Load Balancer. If private networking is disabled, the Load Balancer will contact the Droplet using its public IP address.

Load Balancers support two balancing algorithms: round robin and least connections.

Protocol Support

A single DigitalOcean Load Balancer can be configured to handle multiple protocols and ports. You can control traffic routing is controlled with configurable rules that specify the ports and protocols that the Load Balancer should listen on, as well as the way that it should select and forward requests to the backend servers.

Because DigitalOcean Load Balancers are network load balancers, not application load balancers, they do not support directing traffic to specific backends based on URLs, cookies, HTTP headers, etc.

HTTP

Standard HTTP balancing directs requests based on standard HTTP mechanisms. The Load Balancer sets the X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port headers to give the backend servers information about the original request.

If user sessions depend on the client always connecting to the same backend, a cookie can be sent to the client to enable sticky sessions.

HTTPS and HTTP/2

You can balance secure traffic using either HTTPS or HTTP/2. Both protocols can be configured with:

  • SSL termination, which handles the SSL decryption at the Load Balancer after you add your SSL certificate and private key. Your Load Balancer can also act as a gateway between HTTP/2 client traffic and HTTP/1.0 or HTTP/1.1 backend applications this way.
  • SSL passthrough, which forwards encrypted traffic to your backend Droplets. This is a good for end-to-end encryption and distributing the SSL decryption overhead, but you’ll need to manage the SSL certificates yourself.

You can configure Load Balancers to redirect HTTP traffic on port 80 to HTTPS or HTTP/2 on port 443. This way, the Load Balancer can listen for traffic on both ports but redirect unencrypted traffic for better security.

TCP Balancing

TCP balancing is available for applications that do not speak HTTP. For example, deploying a Load Balancer in front of a database cluster like Galera would allow you spread requests across all available machines.

Let’s Encrypt SSL Certificates

Load Balancer Let’s Encrypt Certificates are fully managed and automatically renewed on your behalf every 60 days. You can use SSL certificates with HTTPS and HTTP/2.

Limits

  • Load Balancers currently do not support IPv6.

  • When using SSL passthrough (port 443 to 443), Load Balancers will not inject x-forwarded-proto, x-forwarded-port, and other x-forwarded-for parameters. Load Balancers will inject those parameters for HTTPS when using SSL termination (port 443 to 80) or HTTP connection (port 80 to 80).

  • Sticky sessions are only visible at the Load Balancer layer; the cookies used for sticky sessions are both set and stripped at the Load Balancer. Because those cookies are not present in the request sent to the backend Droplets, backend applications cannot use them.

  • Load Balancers use http-server-close and keep-alive headers are not honored.

  • The default number of Load Balancers an account can have is 10. This is also affected by the Droplet limit on the account.

  • Load Balancer connections have a keep-alive time of 60 seconds.

  • HTTP health checks are sent using HTTP 1.0. If your web server uses a version other than HTTP 1.0 the headers in the health check may not be compatible and you’ll need to use a TCP check.

Let’s Encrypt

  • You must manage your DNS records on DigitalOcean in order for us to manage Let’s Encrypt on Load Balancers on your behalf.

  • You can only use SSL termination with Let’s Encrypt on DigitalOcean. SSL passthrough requires certificates on the Droplets themselves, and DigitalOcean does not install or maintain certificates on unmanaged services like Droplets.

  • Load Balancers do not support Let’s Encrypt wildcard certificates. Let’s Encrypt added wildcard certificate support in March of 2018 but continues to recommend non-wildcard certificates for most use cases.

  • Let’s Encrypt imposes rate limits of:

    • 20 certificates per registered domain per week
    • 100 names per certificate
    • 5 duplicate domain certificates per week

    If your certificate isn’t issued on the first try, we will automatically retry at 20 minute intervals up to 3 times. After that, we’ll send email to your account’s address letting you know that the certificate creation failed.

  • Let’s Encrypt SSL keys are limited to 2048 bits.