How is traffic distributed across data centers in Datacenter mode?
Short answer
In a domain in Datacenter mode, the addresses of each record are kept in one group per data center (DC № 1, DC № 2 …). DNS Service sorts the data centers that have healthy addresses according to the DC Selection and Selection Criterion setting of the record, and answers with the healthy addresses of the first Total DCs to Select from (default 1) data centers in the order, using Balance Algorithm. DC Selection options: All DC Records (no sorting, the order in the form), DC Based (the metrics of the TR7 device in the data center), Service Based (the metrics in that data center of the vService whose name is entered) and Client Based (a criterion based on the client at the moment of the query; Total DCs to Select from, topology rules and Fail-Safe Records are not applied). The metrics are collected from the data centers defined on the Remote Devices screen.
How Does It Work?
- Health filtering: The addresses in each data center group are filtered according to the HC condition; a data center with at least one healthy address can take part in the selection.
- Sorting: The data centers are sorted according to the selected source and criterion (table).
- Cut: From the order, the first N data centers that have healthy addresses are taken; N = Total DCs to Select from.
- Answer: The healthy addresses of the taken data centers are returned in the answer with Balance Algorithm; if there is no healthy address at all, Fail-Safe Records are returned. In Client Based selection, the cut in step 3 and fail-safe are not applied.
| DC Selection | Selection Criterion | Sorting |
|---|---|---|
| All DC Records | - | The DC № order in the form. |
| DC Based | CPU, Memory, Bandwidth, Status, Packet Loss | The metric of the TR7 device in the data center; for CPU, Memory and Bandwidth, the lowest value first. |
| Service Based | CPU, Memory, Bandwidth, Requests, Connections, New Sessions, Status, Healthy Backends | The metric in each data center of the vService written in the Service Name field; for Status and Healthy Backends, the best value first, and for the others, the lowest value first. |
| Client Based | Number of Hops, MOS, Packet Loss, TTL | The criterion evaluated at each query according to the client. |
DC Based and Service Based metrics are refreshed each time the remote data center is queried (Access Period, default 5 minutes), and the sorting is redone with the new information. A data center whose metric cannot be read is placed at the end of the order.
Datacenter Mode in TR7
- Data centers: In the domain form, Default Mode = Datacenter is selected; the local data center is always one of the groups, and the others are added from the remote data centers on the Remote Devices screen and ordered with the arrow icons.
- Record settings: DC Selection, Selection Criterion, Service Name and Total DCs to Select from appear in the record form, only in Datacenter mode (Record form in Datacenter mode).
- Status: If there is no healthy address in some data centers, the record appears as Partially OK, and if there is none in any of them, as No healthy records or Fail-safe (record status values); the Record Behavior line in the record preview shows DC Selection and Selection Criterion.
- Topology: Topological Selection is also used in this mode; it is not applied in Client Based selection.
Common Misconceptions
- "Datacenter mode splits traffic among data centers by percentage." The mode selects the first N data centers in the order. To spread traffic to all data centers, Total DCs to Select from is set equal to the number of data centers; the ratio between the addresses is given with Weighted Round Robin or Weighted Random (Which distribution algorithms are available between several addresses in a record?).
- "When the remote data center cannot be reached, that data center is disabled on its own." Whether a data center takes part in the selection depends on its addresses in the record being healthy. For the addresses to go down when access is lost, in the HC condition of the addresses, a health scenario that uses the automatic health checks of the remote data center (e.g. Access to
<name>is successful) is selected. - "Total DCs to Select from applies to every source." It is not applied in Client Based selection; in this source, topology rules and Fail-Safe Records are not used either.
- "For Service Based, the vService is selected from a list." Service Name is free text; the name must be exactly the same as the vService name in each data center.
How it is done in the documentation
