1
votes

Let's say I have 5 EC2 instances that all do the exact same thing (e.g application servers) with a load balancer sitting in front of them (AWS Elastic Load Balancer in this case). If I wanted to deploy a new feature but wasn't sure how stable it would be in production, I would deploy it to one instance and monitor it carefully. However, in that case, that instance would still be receiving 1/5th of the traffic so for example, if there were 1000 requests per second total, about 200 requests per second each. How could one go about unevenly distributing the traffic, so that the 'potentially unstable' instance gets, for example, only 50 requests per second while the remaining 950 requests get distributed amongst the other instances?

2

2 Answers

2
votes

You cannot achieve this using ELB. It supports only round robin balancing and does not offer weighted routing.

You can accomplish something similar using Route53, which does support weighted round robin. https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted

1
votes

You can try to use ALB facility from AWS in which you can create your custom set of rules to manage traffic on the basis of different set of rules.

There you can provide the rules for protocols (HTTP/HTTPS) and divert the traffic to that particular instance coming from particular protocol.

Please refer the following url: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html