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 年前1087 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则