Features
Load Distribution
FOGroup - Failover Group
The Failover Group load balancing method is a chained failover. That is, the pool members are configured in an order of preference. If a member is marked as down due to a health check failure, the GSLB will use the next highest priority member of the pool. For example, assume there are three members in a pool that is configured with the 'fogroup' 'lb method'. Connections will be sent to member 1 at all times as it is the first configured member in the pool. If member 1 fails then connections are sent to member 2 as the second configured member in the pool. If member 2 also fails then all the requests will then be sent to member 3. Now, if member 1 were to come back online (member 2 is still down) then all connections would be sent to member 1 again.
WRR - Weighted Round Robin
When Weighted Round Robin is employed as the 'lb method' for a pool, all the requests will be distributed amongst the pool members. The distribution of requests is performed in accordance with the weighting that each member is given. The weight of the member directly relates to the ratio of requests that should be sent to it relative to the weight of the other pool members. It is worth noting that the distribution of requests with regard to the weighting is eventually consistent as requests are sent in batches of three. For example, in a pool configured with 3 members and a 'lb method' of 'WRR' the distribution of requests to members of equal weight would not be 1, 2, 3, 1, 2, 3. It would actually be 1, 1, 1, 2, 2, 2, 3, 3, 3. Modifying the weight of the members, understandably, introduces even more variance.
TWRR - Topology Weighted Round Robin
Topology Weighted Round Robin, is the same as WRR but with an additional piece of evaluation. Before the requests are distribute based on the weighting of the pool they are evaluated against a topology table. Topology tables are configured in the system and are used to associate members with particular IP addresses or ranges. This feature allows administrators to preferentially set the destination for a request based on where the request is coming from. When a DNS request is received by the GSLB, one of the pieces of information that is available to it is the IP or subnet of where the request came from. Let's say you have a data centre in London (10.100.100.10) and a data centre in Madrid ( 10.200.200.10). The users are also based in the UK (10.100.10.0/24) and in Spain (10.200.20.0/24). Either of the data centres is able to service requests from any user and GSLB is being used to increase redundancy and availability. During normal working, it makes sense for requests to be handled by the data centre which is geographically closest to the requester. This can be achieved by configuring a topology of 'Spain' that contains the IPs 10.200.200.20 and 10.200.20.0/24. The topology tells the GSLB that requests which are sourced from 10.200.20.0/24 should be sent to the member 10.200.200.20 as they are linked in the topology table. If the Madrid data centre member was failing health checks then the request would be sent to another valid member in the topology table such as the London data centre. In the case that there are no available members the GSLB would revert to the fallback method which can be either 'refuse' where the DNS request is simply refused or 'any' where a random failing member is sent as a response.
Health Checking
HTTP
HTTP health checks allow the GSLB to make an HTTP GET to the member IPs (or their configured monitor IP, if set) to query their status. There configurable options for this health check are listed below. The HTTP GET that is made is expecting an HTTP code response which will be used to evaluate whether the health check has passed.
Option | Description |
|---|---|
Monitor Use SSL | Whether to use SSL, default is 'No' (false). |
Monitor Hostname | Hostname to supply in HTTP Host: header, when using SSL this will also be supplied in SNI, default is "none". |
Monitor URL Path | A url path to request, appended after the member's IP address, default is "/". |
Monitor Port | An integer between 1 and 65535, if value is not provided, port 80 will be used with use_ssl set to false, port 443 will be used with use_ssl set to true. |
Monitor Expected Codes | An array of HTTP codes to match in a response for example "200", "301". Input range is between 100 and 599 |
TCP
TCP health checks perform a TCP connect against the member IPs (or their configured monitor IP, if set) to check if the GSLB is able to connect to the port of the member. If the port is open/responds then the health check passes. You can optionally provide a send string and an expected response to that string to evaluate the status of the health check.
Option | Description |
|---|---|
Monitor Port | An integer between 1 and 65535, if value is not provided, port 80 will be used with use_ssl set to false, port 443 will be used with use_ssl set to true. |
Monitor Send String | A string to send after connecting to a socket, for example 'check'. |
Monitor Match Return | A reg exp to match in response, for example 'up' (the reg exp compiles with re.IGNORECASE flag set) |
Forced
Forced health checks will always evaluate as passing or failing dependent on the configuration that has been applied.
Option | Description |
|---|---|
Monitor Status | A string, one of 'up' or 'down', default is 'up' |
External
The power and the possibilities of health checking are really unleashed with the external monitor. External monitors are health check scripts that can be created by the administrator to perform any logic that can be programmed in to the GSLB. For example, you can create a script that checks a URL that requires authentication as per the example below. This example is the one provided on the loadbalancer.org appliances as a starting point for people to create their own custom health checks.
External Dynamic Weight
External Dynamic Weight health checks take the power of External health checks and then also provide the ability to update the weight of the members based on the results of those checks. The weights are changed dynamically. As an example, a storage vendor could expose a metric based on disk, network, and CPU utilisation of their nodes and make that information available to be queried by the GSLB external health check. Based on that metric the health check can compute and update the weighting that is set on that member. Members with low utilisation can have their priority raised, reducing the amount of work that high utilisation members are having to do. This allows you to proactively flatten the distribution curve for the members providing a better user experience.
The above bash script creates a health check that queries the members at a URL. That URL returns a response which is a number between 0 and 10 each time the health check is run. That response is then used to set the weight of the server. In this case, the complexity of calculating the weight is left to the server and the GSLB is simply querying the server for what weight it should have based on system utilisation.
SDNS (Smart DNS)
SDNS (Smart DNS) is a way of implementing Global Server Load Balancing in a specific way to leverage the benefits of round-robin DNS whilst dropping some of the biggest problems with it. Typical GSLB implementations on loadbalancer.org appliances are configured with the VIPs of Virtual Services. This allows for the load balancer to handle the load balancing and sending the connections on to the real servers. This method allows you to keep all the benefits of local load balancing whilst also extending the deployment globally via a single namespace. Local load balancing provides features such as session persistence and greater control of connection tracking and distribution that GSLB cannot. With all that being said, there are some implementations that require member IPs to be those of the Real Servers instead of the VIPs of the Virtual Services. In those instances we implement SDNS (Smart DNS) and the GSLB members are the servers providing the service, the GSLB is sending those requests direct to the node.
The primary use case for this method, up until this point, has been where the load balancer could potentially be the bottleneck for network traffic. When the GSLB is configured to distribute requests through the VIPs, the load balancer is still in the path of the traffic as the GSLB is responding with a VIP that will direct the traffic through the load balancer. With SDNS, the GSLB will respond with the IP address for the member/real server/node ip of the ultimate destination. As that traffic is not being directed to a VIP hosted on the load balancer, that traffic will not flow through the load balancer but around the load balancer. This means that the GSLB is able to direct traffic to the required destination not at the speed of the load balancer network interfaces but at the speed of the aggregate network connectivity between source and destination. In reality, most data centres are not connected at greater than 100Gbps...
EDNS-CS
EDNS-CS stands for Extension Mechanisms for DNS - Client Subnet. This is an extension to the DNS protocol that allows a DNS resolver to specify the network subnet for the client making the request, as part of the DNS query. This is particularly useful in the context of Global Server Load Balancing (GSLB) and Content Delivery Networks (CDNs), where it's important to route user requests to the geographically closest or most appropriate server.
EDNS-CS aims to improve the routing accuracy by providing more specific information about the client's location. Normally, the DNS resolver receives the query and passes it on to the authoritative DNS server without any indication of where the original client is located. With EDNS-CS, the resolver can include part of the client's IP address in the request, enabling the authoritative server to make a more informed decision on how to route the client to the most appropriate endpoint.
However, it should be noted that the use of EDNS-CS has been subject to some privacy concerns, as it potentially exposes more information about the client to the authoritative DNS server.
In summary, EDNS-CS is designed to optimize content delivery and server selection by including client subnet information in DNS queries.