By using AWS re:Post, you agree to the Terms of Use

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?
1 Answer
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

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions