This section describes the distribution of traffic for a load balanced group and how it is affected by a planned or unplanned server outage.
A load balancing configuration allows our authoritative DNS servers to distribute requests across various servers or CNAMEs. Five key steps during this process are described below.
The following illustration depicts how requests are load balanced between three different servers.
The manner in which requests will be distributed between the above servers is determined by the weight assigned to each server. More heavily weighted servers (i.e., servers that have been assigned a larger value) will receive more requests than servers that have been assigned a lower weight. The following illustration depicts a load balancing configuration that contains three servers. One of the servers has been assigned a lower load balancing weight than the other two. As a result, less traffic is sent to it.
It is important to note that proportion of traffic that will be sent to a server/CNAME can be calculated through the following formula:
In the above illustration, two servers were assigned a weight of 20 and one server was assigned a weight of 10. The total weight for that load balancing group is 50. This value is calculated by summing the weight assigned to each server (20 + 20 + 10 = 50). The following table uses the above formula to calculate the percentage of traffic that will be sent to each server.
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
A |
20 |
(20/50) * 100 |
40% |
B |
20 |
(20/50) * 100 |
40% |
C |
10 |
(10/50) * 100 |
20% |
Total: |
50 |
Total: |
100% |
The following illustration demonstrates how traffic is redistributed among the remaining servers when a server is removed from a load balancing configuration.
Our health check system will automatically stop directing traffic to a server when it determines that it is unhealthy as defined by your configuration.
In the above illustration, our DNS service stopped serving traffic to a server that was previously receiving 40% of total traffic. This traffic must now be redistributed proportionally among the remaining two servers. We accomplish this by recalculating the traffic percentage using the new total weight value. The new total weight value, which is 30, can be calculated by summing the weight of all active servers in the configuration (20 + 10). The following table uses the above formula to calculate the percentage of traffic that will be sent to each server.
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
A |
0 |
(0/30) * 100 |
0% |
B |
20 |
(20/30) * 100 |
66.67% |
C |
10 |
(10/30) * 100 |
33.33% |
Total: |
30 |
Total: |
100% |
In summary, we can make the following conclusions:
Scenario A: This scenario shows how a server with a weight of 20 will receive the highest proportion of traffic (i.e., 66.66%).
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
1 | 5 | (5/30) * 100 | 16.67% |
2 | 5 | (5/30) * 100 | 16.67% |
3 | 20 | (20/30) * 100 | 66.66% |
Total: | 30 | Total: | 100% |
Scenario B: This scenario shows how the amount of traffic that will be delivered to the same server is dramatically reduced (i.e., 8.89%) when the weight assigned to another server in the group is increased to 200.
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
1 | 200 | (200/225) * 100 | 88.89% |
2 | 5 | (5/225) * 100 | 2.22% |
3 | 20 | (20/225) * 100 | 8.89% |
Total: | 225 | Total: | 100% |
Load balancing allows traffic to be redistributed to healthy servers when a server is pulled out of the load balancing configuration.
A server's relative weight plays an even greater role when a load bearing server is pulled from a load balancing configuration.
Scenario A: Notice that server 3, which has a weight of 20, is receiving 22.22% of all traffic.
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
1 |
10 |
(10/90) * 100 |
11.11% |
2 |
10 |
(10/90) * 100 |
11.11% |
3 |
20 |
(20/90) * 100 |
22.22% |
4 |
50 |
(50/90) * 100 |
55.56% |
Total: |
90 |
Total: |
100% |
Scenario B: This scenario shows how traffic is redistributed when our name servers stop serving traffic to server 4. Although all remaining servers are now receiving twice the amount of traffic, the importance of server 3 has risen since 50% of all traffic is now being directed to it.
Server | Weight | Calculation | Traffic Percentage |
---|---|---|---|
1 |
10 |
(10/40) * 100 |
25% |
2 |
10 |
(10/40) * 100 |
25% |
3 |
20 |
(20/40) * 100 |
50% |
4 |
0 |
(0/40) * 100 |
0% |
Total: |
40 |
Total: |
100% |
Edgecast CDN