Skip to end of metadata
Go to start of metadata

Global Server Load Balancing

AppNexus is proud to offer a number of options to increase redundancy and availability for your applications, including global load balancing between datacenters.  Please note that we have recently shifted from using only F5 hardware load balancers to custom AppNexus-designed load-balancing servers that allow you to manipulate GSLB through an API. Local load balancing still uses F5s.

For a broad overview of Global Server Load Balancing (GSLB) see Global Load Balancing Overview. Below is a more in depth description of GSLB. To go ahead and get started, please see Managing Global Server Load Balancing.

How GSLB Works: An Example

In the below scenario, a user wants to browse www.mysite.com from the Northeastern United States.  In the simplest case, the user's browser would contact www.mysite.com's single server directly and the information transfer would begin.  But because www.mysite.com content resides on several servers in two separate datacenters, the user is routed via a GSLB server and then a Local Traffic Manager (LTM).

Step 1: User's browser performs a DNS lookup for www.mysite.com.  Because the GSLB server at each datacenter anycasts the same IP address, the user is routed by standard Internet protocol to whichever datacenter is closest.  In this case it is New York Metro (NYM1).

Step 2: The NYM1 GSLB has been configured to route users to the closest datacenter.  It first ensures that the NYM1 LTM is still reporting itself as up.  It then responds to the user's DNS request with the NYM1 LTM IP address associated with the www.mysite.com pool.

Step 3: The user's browser requests the main content for www.mysite.com from the LTM IP address.

Step 4: The LTM uses a round-robin method to route the request to Node 2, which happens to be next in line.

Step 5: Node 2 receives and processes the request and passes the appropriate HTML back to the LTM.  The LTM then passes the content on to the user.

Things You Will Need to Use GSLB

  • Fully qualified domain name (FQDN) to be load balanced.  You will either delegate authority of the domain name to gslb.com name servers (ns1.gslb.com, ns2.gslb.com) or set up a CNAME alias.
  • List of IP addresses to be load balanced.  The best practice is to have each IP point to a local load balancer, but if you wish you can have it point to individual servers.
  • Search and request strings for monitoring information.
  • Ratios for each IP. (See below.)

Routing via Ratios

Before load balancing begins, the Global Traffic Monitors on each coast use anycast to broadcast the same IP address so that traffic can be routed via Border Gateway Protocol (BGP) to whichever datacenter is closest. For example a user in Connecticut would probably be routed to NYM1, a user in Nevada would be routed to LAX1 and a user is Prague would likely be routed to AMS1.

Then the GTM uses a routing algorithm to send the traffic on to the preferred datacenter for service.  The main global load balancing algorithm is the "ratios" method.  In other words, when requests come in to a GTM, you decide what percentage of those requests goes to each datacenter.

Examples

For example, if you want proximity routing, you would set the ratio at LAX1 to 100/0 (100 percent of users are routed to LAX1 and zero to NYM1) and the ratio at NYM1 to 100/0 (100 percent of users are routed to NYM1 and zero to LAX1).

Here's a more complicated example. Let's say your users are randomly geographically distributed and on average 50 percent will be initially sent to NYM1 and 50 percent to LAX1. But you have more capacity at LAX1 and you want 70 percent of total traffic to ultimately go there. You can set up the ratio for LAX1 as 70/30 (70% stay in LAX1 and 30% go to
NYM1) and the ratio for NYM1 as 30/70 (30% stay in NYM1 and 70% go to LAX1). Let's check this: (0.7 * 0.5) + (0.7 * 0.5) = 0.7. 70% end up at LAX1.

The Ratio method allows you a lot of freedom in your configurations.  For example, if you want "global availability" for an IP address in LAX1 with a backup in NYM1, we would set the LAX1 ratio to 100/0 and the NYM1 ratio to 0/100.  The GTMs would direct all traffic to LAX1 unless LAX1 was down, in which case all traffic would go to NYM1.

Note that you can also load balance an IP either inside or outside of our datacenters.

Fallback IP or CNAME

As an extra layer of backup, you can specify an external IP address or final CNAME as a failover in case all sites are unavailable.  An example usage would be failover to a CDN, which can serve a static piece of JavaScript or pixels to ensure that visitors to your site don't hang.

Performance Speeds

With regard to response times, GSLB performs nearly as well as static DNS when the Time to Live (TTL) is the same.  If you notice any latency in your response times after setting up GSLB, please check your TTL.

Set Up GSLB Via the API

For instructions on setting up and manipulating GSLB, please see Managing Global Server Load Balancing.

As always, please create a ticket at https://portal.appnexus.com/ or contact us at support@appnexus.com if you have any questions.