Cascaded Hierarchical GSLB Configurations

Global Server Load Balancing (GSLB) offers a lot of cool load balancing mechanisms out of the box. Active/Active, Active/Passive, Geo-IP based, etc. But what if you want to combine multiple of those in a cascaded/hierarchical load balancing decision?

Quick note, in case you ended up here for that particular topic. This has nothing to do with the GSLB Parent-Child Topology introduced in NetScaler 11, that’s a different story.


  1. Background
  2. Solution
  3. Configuration
  4. Result


In a GSLB scenario you often end up having data centers scattered all over the globe. If you want to utilize them Active-Active with Static Proximity (GeoIP based) you could just apply the Static Proximity across all your nodes and that’s it, isn’t it?

In a real world GSLB scenario you typically end up having users gathered around one datacenter and therefore the load is spread uneven.

Let’s take a company that has data centers and users in Europe and North America for example. Let’s say there are two data centers on each continent. However, users are gathered only around one of each data centers in each continent.

Cascaded Hierarchical GSLB: Global Overview

Now that’s a problem if you want to have equal loads. But how can we solve that?


To distribute the load evenly you’d need a load balancing decision based on multiple factors. First factor would be the Static Proximity (GeoIP). Second factor would be Active-Active or Least Connection.

Cascaded Hierarchical GSLB: High Level Architecture

But NetScaler does not offer this cascaded/hierarchical  setup out of the box. You can’t have GSLB vServers pointing to other GSLB vServers to create the setup shown above.

Fortunately in NetScaler 11 GSLB Content Switching was introduced.

This enables us is to create two GSLB vServers, one for each continent. On top of that we can then setup a Content Switch and configure our own GeoIP based logic using NetScalers Advanced Policy Expressions.

Cascaded Hierarchical GSLB: Configuration Schema

This enables a GeoIP based decision tree as follows:

  • If User comes from Europe and Europe is UP => Europe DCs
  • If User comes anywhere and North America is DOWN => Europe DCs
  • If User comes from elsewhere => North America DCs


To configure this we first need two regular GSLB vServers, one for each region. Those could be of any type depending on your desire. In my case I’ve used a simple round robin lab setup without further health checks for demonstration purposes.

The important difference to a regular GSLB vServer setup is that we don’t bind a URL yet. That gets bound to the Content Switch later, similar to how a VIP only gets bound to the Content Switch and not the Load Balancing vServers in a traditional Content Switching setup.

Setup a basic GSLB vServer with two Services for Country-A

add gslb service gslb-hierarchy.gslb.svc.county-a.dc-a HTTP 80 -healthMonitor NO -siteName
add gslb service gslb-hierarchy.gslb.svc.county-a.dc-b HTTP 80 -healthMonitor NO -siteName
add gslb vserver HTTP -backupLBMethod ROUNDROBIN -tolerance 0
bind gslb vserver -serviceName gslb-hierarchy.gslb.svc.county-a.dc-a
bind gslb vserver -serviceName gslb-hierarchy.gslb.svc.county-a.dc-b

Setup a basic GSLB vServer with two Services for Country-B

add gslb service gslb-hierarchy.gslb.svc.county-b.dc-a HTTP 80 -healthMonitor NO -siteName
add gslb service gslb-hierarchy.gslb.svc.county-b.dc-b HTTP 80 -healthMonitor NO -siteName
add gslb vserver HTTP -backupLBMethod ROUNDROBIN -tolerance 0
bind gslb vserver -serviceName gslb-hierarchy.gslb.svc.county-b.dc-a
bind gslb vserver -serviceName gslb-hierarchy.gslb.svc.county-b.dc-b

Now that we have those in place we can go ahead and create the actual Content Switching logic.

First we’d need two Content Switching Actions pointing to the previously created GSLB vServers

add cs action -targetVserver
add cs action -targetVserver

Second we’ll create two Content Switching Policies assigning a region to a client. This is where all the magic happens.

The first policy basically applies “If Europe is UP” AND “Client is from Europe” OR “North America is DOWN”. The second policy just applies to all traffic that didn’t hit the first policy.

add cs policy -rule "( CLIENT.IP.SRC.MATCHES_LOCATION("Europe.*") && SYS.VSERVER("").STATE.EQ(UP) ) || SYS.VSERVER("").STATE.EQ(UP).NOT" -action
add cs policy -rule true -action

Once the policies are in place we can create a Content Switching vServer of type GSLB and bind the CS Policies.

add cs vserver HTTP -targetType GSLB -cltTimeout 180
bind cs vserver -policyName -priority 100
bind cs vserver -policyName -priority 110

Finally we’ll bind the designated GSLB DNS Record to the GSLB Content Switch.

bind cs vserver -domainName gslb-hierarchy.gslb.nerdscaler.lab -TTL 5

And thats it!


This will result in the following. European clients get load balanced between the two services in Country-A.

Cascaded Hierarchical GSLB:

North American and other clients get load balanced between the two services in Country-B.

Cascaded Hierarchical GSLB: American Client Result



2 Replies to “Cascaded Hierarchical GSLB Configurations”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: