Cloudflare Docs
Load Balancing
Load Balancing
Edit this page on GitHub
Set theme to dark (⇧+D)

Add load balancing to Spectrum applications

You can configure Spectrum with Load Balancing to bring resiliency to your TCP or UDP based applications.

Leverage health monitors, failover, and traffic steering by selecting a load balancer as Origin when creating your Spectrum application.

The exact settings will vary depending on your use case. Refer to the following steps to understand the workflow.

​​ Set up

​​ 1. Configure your load balancer

  1. Log in to the Cloudflare dashboard and select an account where the Load Balancing add-on is enabled.

  2. Go to Traffic > Load Balancing.

  3. Select Create Load Balancer.

  4. On the Hostname page, define the settings presented and select Next.

    • Enter a Hostname, which is the DNS name at which the load balancer is available. For more details on record priority, refer to DNS records for load balancing.
    • Keep the orange cloud icon enabled, meaning the load balancer is proxied. This refers to the proxy mode and, with Spectrum, traffic is always proxied.
    • Keep Session Affinity and Failover across pools disabled as these features are not supported with Spectrum.
  5. On the Add an Origin Pool page, define the settings presented and select Next.

  6. On the Monitors page, define the settings presented and select Next.

    • Review the monitors attached to your pools.
    • If needed, you can attach an existing monitor or create a new monitor.
  7. On the Traffic Steering page, choose an option for Traffic steering and select Next.

  8. Keep Custom Rules page empty as this feature is not supported with Spectrum.

  9. On the Review page:

    • Review your configuration and make any changes.
    • Choose whether to Save as Draft or Save and Deploy.

​​ 2. Configure your Spectrum application

  1. Log in to the Cloudflare dashboard.
  2. Select Spectrum.
  3. Select Create an Application. If this is your first time using Spectrum, the Create an Application modal appears.
  4. Select your Application Type.
  5. Under Domain, enter the domain that will use Spectrum.
  6. Under Edge Port, enter the port Cloudflare should use for your application.
  7. Under Origin, select Load Balancer.
  8. Select the load balancer you want to use from the dropdown. Disabled load balancers will not show on the Load Balancer menu.
  9. Select Add.

​​ Limitations

  1. Within Cloudflare, pools represent your origin servers and how they are organized. As such, a pool can be a group of several origin servers, or you could also have only one origin server per pool. ↩︎

  2. A fallback pool is the pool of last resort. When all pools are disabled or unhealthy, this is where the load balancer will send traffic. ↩︎