Global server load balancing

Also known as: GSLB

On this page 7

Global server load balancing, or GSLB, is the practice of distributing client traffic across servers or data centers in different geographic locations, so that each user reaches a healthy site that is close, responsive and not overloaded. In load balancing, it is the layer above local load balancers: while a local load balancer spreads requests among servers inside one site, GSLB decides which site a client should use in the first place.

GSLB serves two main purposes. It improves performance by sending users to nearby or less busy locations, and it provides disaster recovery by steering traffic away from a site that has failed or is under maintenance, often within seconds to minutes.

How global server load balancing directs clients

Most GSLB systems work through DNS. When a client resolves a service name, the GSLB system acts as the authoritative name server for that name and returns the address of the best site for that particular request, based on health checks and the configured policy.

  1. The client asks its resolver for the address of the service name.
  2. The resolver queries the GSLB name server, which is authoritative for that name.
  3. The GSLB system evaluates site health, load, location and policy.
  4. It returns the address of the chosen site, usually the virtual address of a local load balancer.
  5. The client connects to that site, where local load balancing selects a specific server.

Other designs route traffic with anycast, in which several sites announce the same IP address and internet routing delivers each packet to the nearest one. Anycast reacts at the network layer and avoids DNS caching delays, but it offers less fine-grained control than DNS-based policies.

Some providers combine both methods, using anycast for their own name servers and DNS answers for the application itself. A further variant uses HTTP redirection, in which a central entry point answers the first request with a redirect to a regional address. It is precise, because the decision is made per user, but it adds a round trip and works only for web traffic.

Site selection methods

GSLB chooses a site using one or more selection methods, usually applied in order with fallbacks. Health status always comes first: an unhealthy site is removed from consideration regardless of any other criterion.

MethodHow it chooses a siteTypical use
Geographic proximityMaps the resolver location to the nearest siteLower latency for global users
Measured latencyUses round-trip times from probes or clientsPerformance-sensitive services
Weighted distributionSplits traffic by configured percentagesGradual migrations and canary sites
Active-standby failoverUses a backup site only when the primary failsDisaster recovery
Load or capacityPrefers sites with spare capacityUneven traffic or site sizes
Round robinRotates through healthy sitesSimple equal sharing
Common GSLB selection methods

Geographic decisions often rely on the location of the recursive resolver, not the user. A user who relies on a distant public resolver may be sent to the wrong region unless the resolver forwards a client subnet hint, which many resolvers support.

Key parameters that control behavior

The speed and accuracy of GSLB depend on a few parameters that interact with each other. The most important trade-off is between fast failover and the extra load created by short caching times.

ParameterTypical rangeEffect
DNS record TTLAbout 30 to 300 secondsShorter values speed failover but increase queries
Health check intervalAbout 5 to 30 secondsShorter values detect failures sooner
Failure thresholdAbout 2 to 5 failed checksPrevents flapping on single errors
Site weightsPercentages or ratiosControls the share of traffic per site
Main GSLB parameters

Health checks should test the real service, not just reachability. A site whose web servers answer pings but whose database is unavailable must be marked as down, which is why application-level checks against a dedicated status endpoint are preferred.

Health checks should also run from several vantage points. A single probe location may lose connectivity to a site that is perfectly reachable for users, and acting on such a false alarm can shift traffic unnecessarily. Requiring agreement between probes in different networks makes failover decisions considerably more reliable.

GSLB is often confused with plain DNS load balancing and with content delivery networks, but the three solve different problems. The comparison below clarifies where each one fits.

TechniqueDecision basisMain limitation
GSLBHealth, location and policy per queryDepends on DNS caching or anycast routing
DNS load balancingStatic rotation of several recordsNo awareness of site health
Local load balancerServer state within one siteCannot survive the loss of the site
Content delivery networkEdge caches close to usersFocuses on cacheable content
GSLB versus related techniques

In practice these layers are combined: GSLB selects the region, a local load balancer performs TLS termination and spreads requests across servers, and a content delivery network caches static assets at the edge.

Pitfalls in real deployments

GSLB fails most often because of assumptions about caching and state. Clients and resolvers do not always behave as the configuration expects, and multi-site applications have data consistency requirements that traffic steering alone cannot solve.

  • Resolvers may ignore short TTLs, so some clients keep using a failed site for minutes.
  • Sessions do not move automatically: users switched to another site may lose their session unless state is shared.
  • Data replication must keep up, or users see outdated data after failover.
  • The GSLB service itself must be redundant, with name servers in several locations.
  • Untested failover is unreliable: regular drills reveal missing capacity and hidden dependencies.

The simple explanation

Global server load balancing is a traffic director for websites that run in several places at once. When you open such a service, the system checks which of its locations is working, close to you and not too busy, and sends you there.

If one location fails, visitors are sent elsewhere. Much like a navigation app steering drivers around a closed road, it keeps the service reachable even when a whole data center goes offline.

How it is used in practice

An online booking service runs identical application stacks in two data centers, one in Western Europe and one on the East Coast of North America, with databases replicated between them. A GSLB system answers DNS queries for the service name with a TTL of 60 seconds and runs application health checks every 10 seconds.

European users are normally sent to the European site and American users to the American one, which keeps response times low. During a power incident, the European site fails its health checks three times in a row, and the GSLB system starts returning the American address. Within a few minutes, most European users are booking through the other site while engineers restore power.