Doesn't Route53 Weighted Routing switch on every request?

0

My problem

In order to test CLB to ALB migration, I set Route53 Weighted Routing at a ratio of 255 for CLB and 1 for ALB. After waiting for more than 5 minutes, no accesses flowed to ALB at all.

my research

I have configured ELB-A and ELB-B with Route53 Weighted Routing at a ratio of 1:1. I configured ELB-A to return 200 and ELB-B to return 503. I tested the connection using Curl. (Let's say the DNS name is my-test.com)

$ count=0; while true; do echo -n "${count} "; curl -sI my-test.com | grep HTTP | tee -a curl.log; sleep 1; count=`expr $count + 1`; done

The result was that requests were not switched at 50% probability, but switched by group.

$ uniq -c curl.log
   1 HTTP/1.1 503 Service Temporarily Unavailable
  94 HTTP/1.1 200 OK
  46 HTTP/1.1 503 Service Temporarily Unavailable
  43 HTTP/1.1 200 OK

My question

  • Doesn't it switch on a per-request basis?
  • Is the client machine's DNS cache functioning?
  • Am I correct in assuming that there is a 1/255 draw with one chance every 60 seconds for the DNS to be updated?
已提問 2 年前檢視次數 1086 次
1 個回答
0

Doesn't it switch on a per-request basis?

When a request makes it to Route 53, the weighting is applied every time.

Is the client machine's DNS cache functioning?

As mentioned, the request needs to make it to Route 53 in order for the weighting to be applied. If the record is being cached (client cache or resolver cache), the weighting will appear skewed because the request is being "answered" by the cache.

Am I correct in assuming that there is a 1/255 draw with one chance every 60 seconds for the DNS to be updated?

With a TTL of 60 and weighting of 1 and 255 respectively for two records, close. It will be a 1/256 chance to pull the record with weight of 1 and 255/256 for the record of weight 255 [1] when the cache expires.

[1] https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南