Enable weight-based traffic routing in Azure

 Let’s assume you have the application infrastructure like below


User -> Application -> Request Resource(file) with a DNS-> Azure Traffic manager -> Resolves to Azure CDN or AWS Cloud Front endpoint based on priority -> The respective CDN’s mapped to Blob and S3 respectively from Azure and AWS -> The user requested resource(file) present in blob or S3.


Go to the Azure Traffic manager profile

Click on Configuration for the already created Traffic manager profile

Set the routing method to “Weighted” and fill rest of the details






Now you must add endpoints so that it will show the option to enter the “Weight” value















Questions and Answers:

If a client is being served the resources from Azure and what are the chances the same client will get resources from AWS? In this case, how the caching rules for the endpoint will get switched from Azure to AWS or vice-versa?

ANS: The switching of these endpoints would rely on the weight first, architecture second (number of recursive servers involved in resultant DNS), and caching third.

If there are 100 clients requesting the DNS response and the weightage given is equal i.e., 1:1, traffic for 50 clients would go to the first endpoint and the remaining 50 to the second one (Traffic Manager randomly chooses an available endpoint). Only if the cache expires on client 1 after connecting to Endpoint 1 and the Endpoint 1 capacity has been consumed, the request will arrive at endpoint 2.

Once a client makes a DNS request to let’s say Azure CDN Endpoint, the client caches the DNS response, and subsequent requests from the same client will go to Azure Endpoint unless the client cleared all the cache intentionally and executed the weight-based routing algorithm again and randomly selects the other endpoint(Ex: AWS CF), therefore the respective CDN/CF caching rules will remain same and never mixed with both CDN/CF caching rules for the same client.


If I want a few clients should receive traffic from a particular endpoint, how can I achieve this with Weight based traffic management? Additionally, if Endpoint 2 gets degraded and some clients are still making connections, how would request a fallback to Endpoint 1?

Ans: We can only assign the following priority methods: Priority, Weighted, Performance, Geographic, Multivalue, and Subnet. If you can assign the subnet value based on a user/client’s static public IP address, we can route traffic for a specific user/client to a specific endpoint.

Regarding the fallback in case of degradation, please note that endpoint monitoring takes care of that. Once the degradation happens for one endpoint, traffic fallback occurs as monitoring informs the traffic manager profile according to that. That means irrespective of the weight value provided for the endpoints(that means it limits the requests to particular endpoints based on the weight) the fallback will just happen and provide 100% affordability to serve all the requests from the clients.

--Happy Learning
Tarak








Comments

Popular posts from this blog

Azure Traffic Manager Profile - Add as a CNAME to your Custom Domain(DNS) to reolve correctly to your application DNS requests.

FAQs