2

We built a traffic manager with weight routing method (former round robin mode), and configured two endpoints with same weight value.

We expected that the traffic will be evenly distributed to two endpoints. But actually we saw one endpoints got much more traffic than another one.

We then checked the "automation script" of traffic manager on portal and found this:

{
    "name": "test1",
    "type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints",
    "properties": {
        "endpointStatus": "Enabled",
        "target": "www.abc.com",
        "weight": 1,
        "priority": 1,
        "endpointLocation": null
    }
},
{
    "name": "test2",
    "type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints",
    "properties": {
        "endpointStatus": "Enabled",
        "target": "www.xyz.com",
        "weight": 1,
        "priority": 2,
        "endpointLocation": null
    }
}

There is "priority" in the above template, what priority mean in weight routing mode? Will this setting affect the traffic routing?

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
Youxu
  • 1,050
  • 1
  • 9
  • 34

2 Answers2

0

There is "priority" in the above template, what priority mean in weight routing mode?

No matter what mode is configured for traffic manager, these two attributes "weight" and "priority" always exist. In your scenario, the priority will not affect the traffic routing.

But actually we saw one endpoints got much more traffic than another one.

About the weighted method, it is important to understand that DNS responses are cached by clients and by the recursive DNS servers that the clients use to resolve DNS names. This caching can have an impact on weighted traffic distributions. When the number of clients and recursive DNS servers is large, traffic distribution works as expected. However, when the number of clients or recursive DNS servers is small, caching can significantly skew the traffic distribution.

More information about weighted traffic-routing method, please refer to the link.

By the way, these DNS caching effects are common to all DNS-based traffic routing systems, not just Azure Traffic Manager.

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • 1
    Thanks your reply! By "caching", do you mean the TTL value set in Azure traffic manager? We set to 300s, so seems should expire after 5 mins? – Youxu Mar 03 '17 at 08:27
  • The TTL value in not only set in Azure traffic manager, for example, you point your company domain name to xxx.trafficmanager.net, so the TTL value set by you domain provider. – Jason Ye Mar 03 '17 at 08:36
  • If you use xxx.trafficmanager.net to access your web site, yes, the TTL value set in azure traffic manager, and should expire after 5 mins. – Jason Ye Mar 03 '17 at 08:39
  • @Youxu Just checking in to see if the information provided was helpful. Please let me know if you would like further assistance. – Jason Ye Mar 03 '17 at 09:40
  • We used xxx.trafficmanager.net to access your service, I still saw one endpoint got much more traffic than other one after 1 nearly one hour waiting. How to troubleshoot what happened? – Youxu Mar 03 '17 at 10:35
  • by "checking in" do you mean the link you gave in your answer? – Youxu Mar 03 '17 at 10:42
  • These DNS caching effects are common to all DNS-based traffic routing system. In some cases, explicitly clearing the DNS cache may provide a workaround. In other cases, an alternative traffic-routing method may be more appropriate. – Jason Ye Mar 03 '17 at 12:38
  • @Youxu Here a blog about traffic manager,maybe helpful to you. "However, where a small number of clients is used, or all clients sit behind a small number of local DNS servers, caching may skew the traffic distributions. In these cases, traffic should be distributed on a per-connection basis, for example by using application-level HTTP 302 re-directs. " https://azure.microsoft.com/en-us/blog/azure-traffic-manager-external-endpoints-and-weighted-round-robin-via-powershell/ – Jason Ye Mar 03 '17 at 13:32
0

I was hitting an API endpoint and wanted to roll it out gradually with traffic manager to distribute the API calls based on the weights assigned. With sticky sessions, however, this didn't work as expected and the same API response came back.

I resolved this by using a logic app or a serverless function to act as a gateway which resolved a new request each time and bypassed the caching.

Joshua Duxbury
  • 4,892
  • 4
  • 32
  • 51