Cloudflare Load Balancer
You can configure Spectrum and Cloudflare’s Load Balancing to provide TCP healthchecks, failover, and traffic steering to bring resiliency to your Spectrum applications. To prevent issues with DNS resolution for a Spectrum application, do not use the same Spectrum hostname as a current Load Balancing hostname.
TCP health checks
You can configure Cloudflare’s Load Balancer to probe any TCP port for an accepted connection, which is in addition to HTTP and HTTPS probing capabilities.
Health Checks are optional within a Load Balancer. However, without a health check, the load balancer will distribute traffic to all origins in the first pool. With the Health Checks enabled, hosts that have gone into an error state will not receive traffic maintaining uptime. This allows you to enable intelligent failover within a pool of hosts or amongst multiple pools.
The example below shows a TCP health check configuration for an application running on port 2408 with a refresh rate every 30 seconds. You can configure TCP health checks through the dashboard or through Cloudflare’s API.
TCP health check - Dashboard example
TCP health check - API example
Weight configured within a load balancer pool will be honored with load balancing through Spectrum. If configured, Cloudflare will distribute traffic amongst the available origins within a pool according to the relative weights assigned to each origin.
Traffic steering policies
All pool steering modes are available for transport load balancing through Spectrum:
- : Traffic goes from unhealthy pools to the next healthy pool in your configuration.
- : Traffic goes to the fastest pool for a given user.
- : Traffic goes to a specific geographic region or — for Enterprise customers only — specific data centers.
- : Traffic goes to the closest physical data center.