What Is Weighted routing in Networking?
On This Page
What do you want to do?
Quick Definition
Weighted routing lets you send different amounts of traffic to different servers based on the weight you assign to each server. If one server is more powerful or you want to test a new version on a small portion of users, you give it a higher or lower weight. It is like telling a traffic controller to send 70% of cars to one highway and 30% to another, instead of splitting them evenly. This technique is used in cloud load balancers, DNS services, and network routers to manage traffic intelligently.
Common Commands & Configuration
aws route53 change-resource-record-sets --hosted-zone-id Z123456 --change-batch '{"Changes":[{"Action":"UPSERT","ResourceRecordSet":{"Name":"www.example.com","Type":"A","SetIdentifier":"Prod","Weight":50,"TTL":300,"ResourceRecords":[{"Value":"192.0.2.1"}]}}]}'Creates or updates a weighted A record in Route 53 with weight 50 and TTL 300 seconds for www.example.com.
Tests understanding of JSON syntax when configuring weighted routing via CLI; often appears in AWS-SAA lab-style questions.
aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/my-tg/1234567890 --targets Id=i-12345678,Weight=10 Id=i-87654321,Weight=90Registers two EC2 instances with an ALB target group, assigning weights 10 and 90 to control traffic distribution.
CCNA and AWS-SAA exams test that ALB weights are percentage-based relative to sum; here instance A gets 10% traffic.
az network lb address-pool update --lb-name myLB --resource-group myRG --name myBackendPool --vms [{"id":"/subscriptions/.../vm1","weight":50},{"id":"/subscriptions/.../vm2","weight":150}]Updates an Azure Load Balancer backend pool to assign weights 50 and 150 to two VMs, giving VM2 75% of new flows.
Relevant for AZ-104; note that weights in Azure can be 1-256, and higher weight receives proportionally more traffic.
interface GigabitEthernet0/1
bandwidth 100000
delay 10
metric weights 0 1 0 1 0 0
router eigrp 100
network 10.0.0.0Sets EIGRP interface parameters and metric weights (K1=1, K3=1) to influence path selection via weighted composite metric.
CCNA exams test that EIGRP uses weighted formula; changing bandwidth/delay affects which path is preferred.
route-map WEIGHTED permit 10
match ip address 101
set weight 200
route-map WEIGHTED permit 20
set weight 100Configures a route-map to match traffic from access-list 101 and set a weight of 200, influencing BGP path selection.
In Network+ and CCNA, BGP weight is locally significant; higher weight preferred for outbound traffic. Tests understanding of route manipulation.
gcloud dns record-sets update www.example.com --zone=my-zone --type=A --routing-policy=WEIGHTED --routing-policy-data="192.0.2.1=2,192.0.2.2=8"Updates a Cloud DNS record set to weighted round-robin with weights 2 and 8 for two IP addresses.
For Google ACE exam; shows how weighted routing is configured in Google Cloud, with implicit percentage split (20%/80%).
aws route53 change-resource-record-sets --hosted-zone-id Z123456 --change-batch '{"Changes":[{"Action":"UPSERT","ResourceRecordSet":{"Name":"failover.example.com","Type":"A","SetIdentifier":"Primary","Weight":100,"Failover":"PRIMARY","HealthCheckId":"abc123","TTL":60,"ResourceRecords":[{"Value":"203.0.113.1"}]}}]}'Creates a weighted failover record set: primary gets weight 100 with a health check; secondary would have weight 0.
AWS-SAA exams combine weight and failover; if health check fails, weight ignored, all traffic redirected to secondary.
ip route 0.0.0.0 0.0.0.0 10.0.0.1 10
ip route 0.0.0.0 0.0.0.0 10.0.0.2 20Sets two static default routes with administrative distances 10 and 20; lower distance wins, effectively a weighted decision.
Network+ tests that default route selection is based on metric (or administrative distance), which acts as a weight.
Must Know for Exams
Weighted routing is a topic that appears across multiple certification exams, though the depth and context vary significantly. For the AWS Solutions Architect Associate (SAA-C03) exam, weighted routing is a core concept for Route 53. You will encounter it in questions about DNS routing policies, where you need to choose the correct policy for a given scenario-such as 'you want to test a new version of an application with a small percentage of users' or 'you need to distribute traffic across multiple regions with different capacities.' The exam expects you to know the difference between weighted, latency-based, geolocation, and simple routing policies. You may also see weighted routing in the context of Application Load Balancer target groups, where you can set weights on individual targets to control request distribution.
For the Microsoft Azure AZ-104 exam, weighted routing appears in Azure Traffic Manager. You must understand the 'Weighted' traffic-routing method and when to use it versus 'Performance,' 'Geographic,' 'Priority,' or 'Multivalue.' Questions often describe a scenario where on-premises and cloud resources have different capacities or you are performing a migration, and you must configure Traffic Manager profiles with appropriate weights.
On the Google Cloud Associate Cloud Engineer (ACE) exam, weighted routing is relevant for Cloud DNS, where you can create weighted record sets. It is also used in the context of external HTTP(S) load balancers, where you assign weights to backend services to distribute traffic across multiple backends. The exam may ask about designing load balancing for canary deployments or disaster recovery, both of which rely on weighted routing.
For Cisco CCNA and CompTIA Network+ and Security+ exams, weighted routing is less about DNS and more about dynamic routing protocols and link load balancing. On CCNA, you might see questions about EIGRP variance or OSPF cost manipulation to influence path selection, which is a form of weighted routing. Network+ may cover load balancing basics, including weighted round-robin, as part of high availability concepts. Security+ may discuss weighted routing in the context of redundancy and failover design for secure networks.
Exam questions typically test not just definition but application. For example, you might be given a scenario with three servers having specific CPU and memory capacities and asked to recommend appropriate weights. Or you might see a question where a company wants to migrate traffic gradually from an old to a new data center, and you need to select the correct routing method. In AWS exams, always remember that weighted routing does not consider geographic proximity or latency-it only uses the weights you assign. Many learners confuse weighted with latency-based routing, which is a common trap.
To prepare for exam questions on weighted routing, you should practice interpreting weight values in percentages, understand that the sum of weights determines distribution, and know that weights can be changed dynamically without downtime. Also, be aware of the interaction with caching: DNS resolvers cache records, so changes in weighted DNS routing may take time to propagate. This nuance is often tested.
Simple Meaning
Imagine you are the manager of a large call center that handles customer support calls. You have two teams: Team A is a group of experienced agents who can handle complex issues quickly, and Team B is a group of newer agents who are still learning and handle simple requests. You want to make sure that most of the incoming calls go to Team A because they are more efficient, but you still want Team B to get some practice. So, you decide that for every 10 calls, 7 should go to Team A and 3 should go to Team B. This is exactly what weighted routing does in computer networking and cloud services.
In technical terms, weighted routing is a method used by load balancers, DNS services, and routers to distribute incoming traffic across multiple resources-like web servers, databases, or network links-based on a numeric weight that you assign to each resource. The weight represents the proportion of traffic that the resource should handle. If you have three servers with weights of 50, 30, and 20, the first server will receive 50% of the traffic, the second 30%, and the third 20%. This is different from simple round-robin routing, which sends the same number of requests to each server regardless of capacity.
Weighted routing is invaluable in real-world IT environments for several reasons. First, it allows you to handle heterogeneous infrastructure-if one server has twice the processing power of another, you can give it a weight of 2 instead of 1, so it takes on twice the load. Second, it enables canary deployments, where you slowly roll out a new software version to a small percentage of users (say 5%) by setting a low weight for the new version's server, and then gradually increase that weight as you gain confidence. Third, it helps with geographic distribution, where you might want to send more traffic to a data center that is closer to the majority of users or that has lower latency.
Weighted routing is not just about servers and cloud services-it also applies to network routing protocols like OSPF and EIGRP, where you can assign different costs or metrics to different links to influence how much traffic goes over each path. The core idea is always the same: you have multiple options, and you want to send traffic in a controlled, uneven manner to achieve better performance, reliability, or testing capabilities.
Full Technical Definition
Weighted routing is a traffic engineering technique used at multiple layers of the OSI model-primarily at the network layer (Layer 3) and application layer (Layer 7)-to distribute data packets or application requests across multiple paths or endpoints based on assigned numeric weights. The weights are typically integers or floating-point numbers that define the relative proportion of traffic each path or target should handle. The sum of all weights in a routing pool determines the total number of 'virtual units' of traffic; each target receives traffic in proportion to its weight divided by that total.
In the context of application delivery and cloud load balancing, weighted routing is commonly implemented via DNS-based load balancing (e.g., AWS Route 53 weighted record sets), application load balancers (e.g., AWS ALB, Azure Traffic Manager), and reverse proxy servers (e.g., NGINX, HAProxy). For example, in AWS Route 53, you create multiple A or AAAA records with the same name but different values (IP addresses), and each record has a weight. When a DNS query arrives, Route 53 selects one of the records using a weighted random selection algorithm: it generates a random number between 0 and the sum of all weights, then iterates through the records in order, subtracting each record's weight until the value reaches zero or below, and returns that record's IP address. This is sometimes called 'weighted random load balancing' or 'proportional distribution.'
At the network layer, weighted routing appears in routing protocols like OSPF (Open Shortest Path First) and EIGRP (Enhanced Interior Gateway Routing Protocol). OSPF uses a cost metric based on bandwidth; by adjusting the cost (which is inversely related to the weight), you can influence traffic flow. EIGRP uses a composite metric that can include bandwidth, delay, load, and reliability; you can set weights to prefer one path over another. In these protocols, weighted equal-cost multipath (ECMP) allows multiple routes with different costs to be used simultaneously, with traffic distributed proportionally. This is often implemented using per-packet or per-flow load balancing, where hashing algorithms (e.g., based on source/destination IP, port, or protocol) map flows to paths in a weighted manner.
In load balancers like NGINX, the 'weight' parameter in an upstream server block defines the ratio of requests sent to each server. For example, if you have backend servers A, B, and C with weights 5, 3, and 2 respectively, NGINX will send 5 out of every 10 requests to A, 3 to B, and 2 to C, assuming a simple round-robin base algorithm. More advanced algorithms like least connections or IP hash can also incorporate weights. Similarly, Azure Traffic Manager uses weighted routing in its 'Weighted' traffic-routing method, where you assign a weight to each endpoint in a profile, and traffic is distributed according to those weights across all enabled endpoints.
From a mathematical standpoint, weighted routing ensures long-term proportional distribution, but short-term deviations can occur due to random selection or hashing artifacts. For mission-critical systems, administrators must consider the 'stickiness' of sessions-if a user session is not tied to a specific server (sticky sessions), a weighted routing algorithm may send subsequent requests from the same user to different servers, which can break stateful applications. Therefore, weighted routing is often combined with session affinity (also called persistence) mechanisms, such as cookies or source IP hashing.
Protocols and standards that support weighted routing include: DNS (RFC 1035) with custom weight fields in some implementations, HTTP/1.1 load balancers, gRPC load balancing policies, and network-layer protocols like OSPF (RFC 2328) and EIGRP (Cisco proprietary). In software-defined networking (SDN), weighted routing can be implemented programmatically via APIs, allowing dynamic weight adjustments based on real-time metrics such as CPU usage, latency, or error rates.
A key consideration is the distribution granularity. At the DNS level, weighted routing is coarse because DNS caching by resolvers and clients can cause traffic to be unevenly distributed for long periods. For fine-grained control, Layer 7 load balancers are preferred. In exam contexts, especially for AWS SAA, Azure AZ-104, and Google ACE, understanding weighted DNS routing (Route 53 Weighted Records, Azure Traffic Manager Weighted, Google Cloud DNS Weighted Routing Policies) is essential. For networking exams like CCNA and Network+, weighted routing is relevant in the context of load balancing with multiple WAN links or routing protocol metrics. Security+ may touch on its use for redundancy and failover in secure network designs.
Real-Life Example
Think about a large pizza restaurant that has three ovens. The first oven is a huge, industrial-sized oven that can cook 10 pizzas at a time and is very fast. The second oven is a medium-sized one that can cook 4 pizzas at once. The third oven is a small, older oven that can only handle 1 pizza at a time. If the restaurant gets a rush of 100 pizza orders, the manager cannot send the same number of orders to each oven because they would get overloaded differently. Instead, the manager decides to send 10 pizzas to the huge oven for every 4 sent to the medium oven and every 1 sent to the small oven. This way, each oven works at its full capacity, and all pizzas are cooked as quickly as possible.
This is exactly how weighted routing works in IT. The ovens are your servers or network links, and the numbers (10, 4, 1) are the weights. The huge oven gets a weight of 10, the medium one gets 4, and the small one gets 1. The total weight is 15. Out of every 15 requests, 10 go to the big oven, 4 to the medium oven, and 1 to the small oven. This ensures that no resource is overworked or underused, and the overall system operates efficiently.
Another analogy is a team of workers unloading a truck. One worker is very strong and can carry heavy boxes quickly, another is average, and a third is slower or injured. You would naturally ask the strong worker to carry more load than the others. That is a manual form of weighted distribution. In the digital world, weighted routing automates this decision so that the system handles millions of requests per second without human intervention.
In your own life, you might use a similar principle without thinking about it. For example, if you have two computers at home-one is a powerful gaming PC and the other is an old laptop-you might decide to run heavy software like video editing on the PC and only light web browsing on the laptop. That is you acting as a weighted router, sending more 'traffic' to the resource that can handle it best.
Why This Term Matters
Weighted routing matters because it directly impacts the performance, reliability, and cost-efficiency of IT systems. In modern cloud architectures, where applications serve millions of users, you cannot afford to treat all servers as equal. Some servers are more powerful, some are in different geographic regions, and some are dedicated to specific tasks. Weighted routing allows you to allocate traffic exactly where it is most effective.
From a practical IT perspective, weighted routing is essential for capacity planning. When you upgrade your infrastructure, you might add a new server that is twice as fast as the existing ones. Without weighted routing, the new server would receive the same number of requests as the older, slower servers, causing a bottleneck. With weighted routing, you can give the new server a higher weight so that it handles a proportional share of the load, maximizing your investment.
Weighted routing also plays a critical role in disaster recovery and high availability. If one data center has a partial failure (e.g., some servers are down), you can reduce its weight in DNS or load balancer configuration to send more traffic to healthy data centers. This can be automated with health checks that adjust weights dynamically. In contrast, simple round-robin would continue sending an equal share of traffic to the degraded data center, potentially overwhelming remaining servers and causing service outages.
For businesses that need to roll out new software gradually (canary deployments), weighted routing is a must-have. You can deploy a new version to one server with a low weight-say 5%-while 95% of traffic goes to the stable version. If the new version works well, you gradually increase its weight until it handles 100% of traffic. This minimizes the blast radius of any bugs and allows you to monitor performance with real user traffic.
Finally, weighted routing helps with cost optimization in cloud environments. Many cloud providers charge per gigabyte of data transferred or per request. By routing more traffic to cheaper regions or during off-peak hours, you can reduce operational costs. Understanding weighted routing is therefore not just a technical skill but a business advantage for any IT professional managing production systems.
How It Appears in Exam Questions
Weighted routing appears in certification exams in several distinct patterns. The most common is the 'scenario-based selection' type. For AWS, you might see: 'A company is launching a new version of its web application. They want to test it with 10% of users before full rollout. Which Route 53 routing policy should be used?' The answer is weighted routing, with the stable version having a weight of 90 and the new version a weight of 10. Another variant: 'You have three EC2 instances behind an Application Load Balancer. Instance A has 2 vCPUs, Instance B has 4 vCPUs, and Instance C has 1 vCPU. What is the best way to distribute traffic?' The correct approach is to configure target group weights proportional to vCPU counts (e.g., 2, 4, 1).
Another pattern is the 'configuration' type, where you are given partial configuration snippets (JSON, YAML, or console screenshots) and asked to identify missing or incorrect parameters. For example, in Azure Traffic Manager, you might see a profile configured with 'Weighted' routing and endpoint weights of 100 and 200, but the health check is disabled. The question might ask why traffic is not being distributed correctly. The answer could involve health monitoring-weighted routing only sends traffic to healthy endpoints, so a disabled health check might cause all traffic to go to one endpoint if another is considered unhealthy.
In networking exams, weighted routing questions often involve routing protocol metrics. For CCNA, you might see: 'An OSPF network has two links to the same destination: a 1 Gbps fiber link and a 100 Mbps copper link. How does OSPF handle this?' The answer involves the cost metric-the faster link gets a lower cost and thus is preferred, but you can manipulate costs (weights) to achieve load balancing across unequal-cost paths. You might also encounter questions about EIGRP variance, where the variance multiplier allows unequal-cost load balancing, which is a form of weighted routing.
Troubleshooting questions are also common. For example: 'After configuring weighted routing in Route 53, some users are still experiencing issues and sessions are being dropped. What could be the problem?' The answer often points to lack of session persistence (sticky sessions), because weighted routing alone does not ensure that a user's subsequent requests go to the same server. Another troubleshooting scenario: 'An administrator set weights of 10 for server A and 0 for server B, expecting no traffic to server B, but still sees requests going to server B. Why?' This could be due to DNS caching, where resolvers have cached the older record set, or because the health check on server A failed, causing Route 53 to ignore its weight and send traffic to the only healthy endpoint (server B).
Finally, there are multi-answer questions where you must select all correct statements about weighted routing. For instance: 'Which of the following are true about AWS Route 53 weighted routing policy? (Select three.)' Options might include: 'Weights can be any integer from 0 to 255,' 'The weight of a record relative to the total weight determines the probability that it will be selected,' 'You can associate health checks with weighted records,' and 'Weighted routing can be combined with latency-based routing.' The correct ones are the first three; combining with latency-based is not a standard feature.
To excel, practice reading weight values as proportions, not absolute percentages. If the total weight is 300 and a server has a weight of 150, it gets 50% of traffic. But if that server fails its health check, its weight is effectively 0, and the remaining servers share traffic proportionally based on their weights.
Practise Weighted routing Questions
Test your understanding with exam-style practice questions.
Example Scenario
Scenario: A company called 'CloudMart' runs an e-commerce website that sells electronics. They have two web servers: Server A is a new, powerful server located in a data center in Virginia, USA. Server B is an older, less powerful server located in Oregon, USA. The majority of CloudMart's customers are on the East Coast, closer to Server A, but they also want to ensure that Server B is used enough to justify its cost and to provide failover capacity. The IT team decides to use AWS Route 53 with weighted routing to manage the traffic.
Step 1: The team creates two A records in Route 53 for 'www.cloudmart.com', one pointing to the IP address of Server A and one to Server B. They assign a weight of 80 to Server A and a weight of 20 to Server B. This means that, on average, 80% of DNS queries will resolve to Server A, and 20% to Server B. They also configure health checks for both records so that if one server goes down, Route 53 automatically stops sending traffic to it, and all traffic goes to the healthy server.
Step 2: A user in New York types 'www.cloudmart.com' into their browser. Their DNS resolver sends a query to Route 53. Route 53 picks a random number between 0 and 100 (the sum of weights). If the number is between 0 and 80, it returns Server A's IP; if between 80 and 100, it returns Server B's IP. Over time, the distribution matches the weights.
Step 3: The team monitors the traffic. Because Server B is less powerful, it receives only 20% of the traffic, which it can handle comfortably. Server A, being more powerful, handles 80% without breaking a sweat. The site runs smoothly because the weights are balanced according to each server's capacity.
Step 4: After a few weeks, the team decides to upgrade Server B to match Server A's capacity. They change the weights to 50 each, effectively enabling equal load balancing. They do not need to restart any service-the change is immediate for new DNS lookups.
Step 5: Later, CloudMart launches a new feature. They create a third server (Server C) with the new software. They assign a very low weight, say 5, to Server C, while keeping Server A and B at 47 and 48 respectively (total 100). Now 5% of users get the new feature, allowing the team to test performance and catch bugs early. If the new feature works perfectly, they gradually increase Server C's weight and eventually decommission the old servers.
This scenario shows how weighted routing allows the team to manage capacity, perform canary deployments, and ensure high availability with minimal configuration.
Common Mistakes
Assuming weights represent actual percentages rather than relative proportions
Weights are not percentages-they are relative to the sum of all weights in the pool. If you have two servers with weights 10 and 10, each gets 50%. But if you add a third server with weight 10, each now gets 33.3%. Learners often think a weight of 10 means 10% of traffic, which is only true if the total weight is 100.
Calculate the actual proportion by dividing the individual weight by the sum of all active weights. Remember that the sum changes when you add or remove targets.
Thinking weighted routing works in real time and ignores DNS caching
Weighted DNS routing relies on DNS resolvers and clients caching records for the TTL (Time-To-Live). Changes to weights do not take effect immediately-they are subject to cache expiry. A learner might change weights and expect traffic to rebalance instantly, only to see uneven distribution for hours.
Always consider TTL values when planning weight changes. For critical changes, reduce TTL beforehand, make the change, and wait for cache to expire. Remember that weighted routing at DNS level is coarse-grained due to caching.
Confusing weighted routing with latency-based or geolocation routing
Weighted routing only considers the numeric weights you assign; it does not look at where the user is located or the latency to the server. Learners often choose weighted routing when the requirement is 'send traffic to the closest server' or 'send traffic to the region with lowest latency.'
Read the scenario carefully: if the goal is to control traffic percentage regardless of user location, use weighted. If the goal is to optimize for user proximity or latency, use latency-based or geolocation routing instead.
Setting weights to 0 thinking it will prevent traffic completely but forgetting about health checks
If an endpoint has a weight of 0, it will not receive new traffic under normal circumstances. However, if all other endpoints fail their health checks, a load balancer or DNS service may still route traffic to the endpoint with weight 0 because it is the only healthy one. Learners often assume weight 0 is absolute.
If you want to ensure an endpoint receives no traffic, either remove it from the pool or disable it entirely (not just set weight to 0). Also, combine with health checks so that if other endpoints become unhealthy, you can manually intervene.
Forgetting that weighted routing at the load balancer level may not provide session persistence
Weighted round-robin algorithms distribute requests based on weights, but they do not guarantee that subsequent requests from the same user go to the same server. This can break applications that store session data locally on the server (stateful applications). Learners might configure weighted routing and then wonder why users are losing shopping carts or login sessions.
If your application is stateful, enable sticky sessions (session affinity) in addition to weighted routing. Most load balancers allow you to set a cookie or use source IP hash to maintain session stickiness, while still distributing overall traffic according to weights.
Exam Trap — Don't Get Fooled
{"trap":"In an exam question, you are asked to select a routing policy for a scenario where a company wants to 'send most traffic to the primary data center, but route some traffic to a secondary data center for capacity testing.' The options include weighted, latency-based, geolocation, and failover. Learners often choose 'failover' because it sounds like 'secondary,' but failover only sends traffic to the secondary when the primary is unhealthy, not for a percentage split.
They also confuse weighted with latency-based because the secondary might be farther away.","why_learners_choose_it":"The word 'secondary' triggers an association with failover, and many learners do not consider that failover does not allow for a controlled percentage split. Some might think that testing capacity needs to consider latency, so they choose latency-based, not realizing that weighted routing is the only one that allows arbitrary percentages."
,"how_to_avoid_it":"Learn the exact use case for each routing policy. Weighted is for percentage-based distribution. Failover is for active-passive with health checks. Latency-based sends traffic to the endpoint with the lowest latency for the user.
Geolocation routes based on the user's geographic location. When you see '%' or 'proportion' in the scenario, think weighted. When you see 'backup' or 'if primary fails,' think failover."
Commonly Confused With
Round-robin distributes traffic sequentially and equally across all available servers, without any consideration for capacity or weight. Weighted routing intentionally gives some servers more traffic than others. Round-robin is simpler but cannot handle heterogeneous environments where servers have different capabilities.
If you have servers with 2 GB RAM and 8 GB RAM, round-robin sends the same number of requests to both, overloading the smaller server. Weighted routing lets you send 80% to the powerful server and 20% to the weaker one.
Latency-based routing (like AWS Route 53 latency policy) automatically sends traffic to the endpoint that provides the lowest latency for the user. It does not use weights-it measures network delay in real time. Weighted routing ignores latency entirely and only uses the numeric weight you assign. You would use latency-based when you want to optimize for speed, and weighted when you want to control the proportion of traffic.
If you have servers in Virginia and Ireland, latency-based routing sends European users to Ireland automatically. Weighted routing would send a fixed 70% to Virginia and 30% to Ireland regardless of where the user is, which might cause poor performance for European users.
Failover routing (active-passive) sends all traffic to a primary endpoint as long as it is healthy, and only switches to a secondary endpoint when the primary fails. Weighted routing allows multiple endpoints to receive traffic simultaneously, with controlled proportions. Failover is a binary on/off for the secondary, not a gradual percentage.
For a disaster recovery setup, you might use failover: all traffic goes to the primary data center. If a hurricane hits the primary, traffic automatically goes to the secondary. Weighted routing would split traffic between both even when both are healthy, which is not ideal for a DR scenario.
Geolocation routing directs traffic based on the geographic origin of the DNS query (e.g., users in Europe go to an EU server). It can also restrict traffic so that users from certain countries only see specific endpoints. Weighted routing has no geographic awareness-it randomly distributes traffic based on weights. Geolocation is for compliance (e.g., GDPR) or content localization, while weighted is for load distribution.
A streaming service might use geolocation to send UK users to a UK server for licensing reasons. If they also wanted to test a new interface on 10% of all users regardless of location, they would combine geolocation with weighted routing inside each region.
Simple routing (AWS Route 53) maps a domain to a single resource. It cannot distribute traffic across multiple resources. Weighted routing is specifically designed to distribute traffic across multiple resources with customizable proportions. Simple is fine for a single web server, but not for load balancing or canary deployments.
A small blog hosted on one EC2 instance uses simple routing. A large e-commerce site with multiple servers must use weighted (or another multipolicy) to balance the load.
Step-by-Step Breakdown
Identify the resources that will receive traffic
These could be web servers, application servers, database replicas, or network links. In a cloud environment, you might have EC2 instances, load balancers, or IP addresses. Each resource will be assigned a weight that determines its share of incoming requests. This step is crucial because you cannot assign weights to resources that do not exist or are not configured correctly.
Determine the capacity or importance of each resource
Evaluate factors like CPU cores, memory, network bandwidth, geographic proximity to users, or whether the resource is running a canary version. Higher capacity resources should receive higher weights. For example, a server with 8 vCPUs might get a weight of 8, while one with 2 vCPUs gets a weight of 2. This ensures that the total load aligns with each server's ability to handle it.
Assign a numeric weight to each resource
Weights are typically integers, though some systems allow decimals. In AWS Route 53, weights can be between 0 and 255. A weight of 0 means the resource should not receive traffic (unless all others are unhealthy). The actual weight values do not matter by themselves-only the ratio between them matters. If resource A has weight 4 and resource B has weight 1, A gets 80% of traffic.
Configure the routing mechanism (DNS record, load balancer, router)
This is the implementation step. For DNS, you create multiple records with the same name and type, each with a different weight. For a load balancer, you add servers to a target group and set weight per target. For a router, you adjust OSPF cost or EIGRP variance. The configuration syntax varies by vendor, but the concept is the same: the system will use the weights to decide how to distribute traffic.
Enable health checks (if available)
Weighted routing works best when combined with health checks. If a resource becomes unhealthy, the routing system should automatically stop sending traffic to it, redistributing that traffic among the remaining healthy resources based on their weights. Without health checks, traffic continues to be sent to a failed server, causing errors for users. Most cloud services require health checks to be configured separately.
Test the configuration with small traffic volume
Before rolling out to production, it is wise to test with low traffic or a small subset of users. For DNS, you can set the TTL to a low value (e.g., 60 seconds) so changes propagate quickly. For load balancers, you can monitor logs or use test endpoints to ensure traffic percentages match the weights. This step helps catch misconfigurations early.
Monitor and adjust weights as needed
After deployment, continuously monitor metrics like CPU utilization, error rates, and response times. If one server is overloaded despite its weight, you may need to reduce its weight or increase the weight of underutilized servers. In a canary deployment, you gradually increase the weight of the new version over hours or days. Weighted routing is not a set-it-and-forget-it-it requires ongoing adjustment to match changing conditions.
Document the weight configuration and reasoning
In a production environment, multiple team members may need to understand why certain weights were chosen. Documenting the reasoning (e.g., 'Server A weight 10 due to 8 vCPUs, Server B weight 5 due to 4 vCPUs') helps with troubleshooting and future changes. It also ensures compliance with any change management processes in your organization.
Practical Mini-Lesson
Weighted routing is a practical skill that every IT professional managing production services should master. In the real world, you will rarely have identical servers. Even in cloud environments, where you can launch instances with the same specifications, you might have different application versions, regional data centers with different costs, or legacy systems that cannot be upgraded. Weighted routing gives you fine-grained control over how traffic flows, enabling you to maximize performance and minimize risk.
Let us walk through a practical configuration using AWS Route 53 as an example, because it is one of the most common implementations. Suppose you own the domain 'example.com' and you have two web servers: Server 1 with IP 203.0.113.10 (weight 80) and Server 2 with IP 203.0.113.20 (weight 20). You would log into Route 53, select your hosted zone, and create two A records. For each record, you specify the name 'example.com', type A, alias No, Value (IP address), and Routing Policy 'Weighted.' You then assign a weight (80 for the first, 20 for the second) and, optionally, a Set ID to distinguish them. You also set a TTL; a common practice is 300 seconds (5 minutes) for production, but you might lower it to 60 when making changes.
Once configured, Route 53 will respond to DNS queries by randomly selecting one of the records based on the weights. However, there is a subtlety: DNS resolvers often cache the result for the entire TTL period, so if you have many users behind the same corporate DNS resolver, they might all resolve to the same server for a while. This is why weighted DNS routing is considered 'coarse-grained.' For finer control, you would use a Layer 7 load balancer like an Application Load Balancer (ALB) or NGINX. In an ALB, you create a target group, add targets (the IP addresses of your servers), and for each target you specify a weight. The ALB then distributes incoming HTTP requests based on those weights, and because there is no DNS caching at the load balancer level (the ALB's IP is what the browser connects to), the distribution is much more accurate.
What can go wrong? The most common issue is that administrators forget to enable health checks. Without health checks, if a server crashes, the routing system continues to send a portion of traffic to the dead server. This leads to errors for users. Always configure health checks and ensure they are pointing to a meaningful endpoint (e.g., '/health' on the web server). Another issue is misinterpreting the weight values. For example, if you set the weights too low (like 1 and 1) for a pool that should handle millions of requests, the load balancer will still split traffic evenly, but the low weights do not cause problems by themselves. However, if you accidentally set a weight of 0 for all servers, no traffic will be routed-though some systems might fall back to a default if all weights are 0.
For professionals working with hybrid environments (on-premises and cloud), you might use weighted routing to gradually migrate traffic. For instance, you could keep the on-premises server at weight 80 and the new cloud server at weight 20, then over weeks shift the weights until 100% is in the cloud. This allows you to validate performance, costs, and security before the full migration. Weighted routing also pairs well with autoscaling: you can dynamically adjust weights based on instance metrics using scripts or AWS Lambda, creating a self-healing, adaptive system.
Finally, always test your weighted routing configuration in a lower environment first. Many outages have been caused by a simple typo in the weight value (e.g., setting weight 1000 instead of 10) that overwhelmed a small server. Use monitoring dashboards to verify that the actual traffic distribution matches the intended weights within an acceptable margin of error (usually a few percent).
Weighted Routing Fundamentals and Use Cases
Weighted routing is a traffic distribution mechanism that allows administrators to assign numerical weights to multiple endpoints, such as servers, load balancers, or network paths, enabling granular control over the proportion of incoming traffic each endpoint receives. Unlike simple round-robin or random distribution, weighted routing directs traffic based on predefined ratios, making it indispensable for scenarios like gradual rollout of new software versions, A/B testing, load balancing across heterogeneous infrastructure, and disaster recovery planning. In cloud environments, such as with AWS Route 53 weighted record sets, each resource record can be assigned a weight value, and the DNS service calculates the probability of sending a query to a particular endpoint by dividing that endpoint's weight by the sum of all weights.
For example, if three servers have weights 10, 20, and 70, the first receives 10% of traffic, the second 20%, and the third 70%. This approach is also fundamental in contexts like weighted fair queuing in networking, where packets from different flows are serviced based on allocated weights to ensure quality of service. For exam purposes, you must understand that weighted routing does not guarantee absolute traffic percentages but rather a statistical distribution over time; short-lived tests may show deviation, but large sample sizes converge to the intended ratio.
Weighted routing can be combined with health checks: if an endpoint fails a health check, it is automatically removed from rotation, and its weight is effectively redistributed among remaining healthy endpoints. On the AWS Certified Solutions Architect (SAA) exam, you might encounter scenarios where weighted routing is used to migrate traffic from one version of an application to another or to balance traffic between multiple regions with different capacities. Similarly, for the CCNA and Network+, weighted routing appears in the context of routing protocols like EIGRP, which uses a composite metric based on bandwidth, delay, load, and reliability to weight paths, or in policy-based routing where administrators set weights to influence path selection.
Understanding the balance between deterministic and probabilistic behavior is key to troubleshooting and designing resilient systems. Weighted routing also supports multi-value answers, where multiple weighted records are returned, allowing clients to receive multiple IP addresses and select one at random, further distributing load. This flexibility makes it a powerful tool for optimizing performance, reducing latency, and managing costs across distributed architectures.
DNS Weighted Routing Configuration in AWS Route 53
Configuring weighted routing in AWS Route 53 involves creating multiple DNS records with the same name and type but different weights, each pointing to a distinct resource such as an ALB, EC2 instance, or IP address. The sum of all weights does not need to equal 100; the distribution is relative. For instance, if you assign weight 1 to a new application version and weight 3 to the old version, the new version receives 25% of traffic.
This is ideal for canary deployments. To set up weighted routing via the AWS Management Console, you navigate to the hosted zone, create a record set, choose routing policy as 'Weighted', enter a weight (0-255), and optionally set a record ID and health check. AWS CLI commands like 'aws route53 change-resource-record-sets' with JSON formatted changes allow scripting of these configurations.
The JSON includes the 'Weight' element under 'AliasTarget' or 'ResourceRecord'. In exam scenarios, you might be asked to design a migration strategy from a legacy server to a new fleet. Using weighted routing, you can gradually increase the weight of the new records while monitoring error rates.
A common pitfall is that if all weights are set to 0, no traffic is routed to that record set, which can cause a service outage. Route 53 weighted routing supports latency-based, geolocation, and failover routing policies but only one policy per record set. When integrating health checks, Route 53 stops responding to DNS queries with the endpoint's IP if it is unhealthy, effectively ignoring its weight.
This behavior is critical for high availability. For the AWS-SAA exam, you must remember that weighted routing records are independent; you cannot have multiple values in one record; each endpoint requires a separate record. The DNS caching time (TTL) also affects how quickly changes propagate.
During exam questions, you may need to calculate traffic percentages or identify why a new deployment is not receiving expected traffic, likely due to a misconfigured weight or a health check failure. Also, note that Route 53 weighted routing is not real-time; DNS resolvers cache records for the TTL duration. For the Google Cloud Professional (ACE) exam, Cloud DNS offers similar weighted round-robin but policy-based, and Azure DNS supports weighted routing via Traffic Manager profiles.
Understanding these nuances helps you tackle cross-platform exam questions effectively.
Weighted Routing in Load Balancers and Network Infrastructure
Beyond DNS, weighted routing is implemented in application load balancers (ALBs) and network devices to distribute traffic based on server capacity or administrative policy. In AWS, ALB target groups support weighted routing by assigning weights to individual targets. This allows you to send more traffic to a server with higher processing power while sending less to a smaller instance.
The weight is set in the target group configuration using the 'weight' parameter when registering instances. For example, if you have a c5.xlarge (weight 100) and a t2.micro (weight 10), the larger instance receives approximately 91% of traffic.
This is extremely useful for rightsizing infrastructure and avoiding over-provisioning. In the context of the Security+ exam, weighted routing can be part of a load balancer security strategy, ensuring that high-risk traffic is directed to isolated, heavily monitored servers for inspection. Similarly, in traditional networking, Cisco's GLBP (Gateway Load Balancing Protocol) uses weighted load balancing where multiple routers share the virtual IP, and weights determine how many clients each router handles.
Weighted Fair Queuing (WFQ) within routers assigns weights to flows to guarantee bandwidth allocation. For the CCNA exam, you must know that EIGRP uses a weighted composite metric (bandwidth, delay, load, reliability, MTU) to choose the best path; the path with the smallest metric (or highest weight for some implementations) is preferred. In policy-based routing (PBR), you can set weights to match traffic and forward based on criteria.
On the Network+ exam, understanding how weighted load balancing differs from round-robin and least connections is essential. One troubleshooting clue is that if weights are not properly calibrated, you may observe uneven performance; for example, low-weight servers might become overwhelmed if they handle a disproportionate number of slow requests. Load balancer logs and metrics (like request count per target) help identify such imbalances.
For Azure Administrators (AZ-104), Azure Load Balancer offers weighted distribution via backend address pools; you can set 'weight' for each VM to influence how many new flows are directed to it. In high-traffic scenarios, weighted routing helps maintain performance during scale-in and scale-out events. The key exam takeaway is that weighted routing at the load balancer level operates at Layer 4 or Layer 7, affecting connection distribution, while DNS-level weighted routing affects DNS query responses.
Both can coexist: first DNS weight distributes clients to different load balancers, then each load balancer uses its own weights to distribute requests to backends. This layered approach is common for multi-region deployments.
Troubleshooting Weighted Routing Issues and Exam Traps
Weighted routing configurations can introduce subtle issues that often appear in scenario-based exam questions. The most common problem is traffic distribution not matching the expected ratios, especially during short observation periods. Because weighted routing is probabilistic, the law of large numbers applies: only after many requests does the distribution converge.
On the exam, you might see a question where an engineer sets weights 50/50 for two servers but sees 60/40 split after 1000 requests. The correct answer is that this is normal and expected; it does not indicate a misconfiguration. Another frequent issue is a sudden spike in traffic to a single endpoint due to a health check failure or weight misconfiguration.
For instance, if one endpoint fails health checks, its weight is effectively zero, and all traffic goes to remaining endpoints. This can cause overloading. Troubleshooting involves checking health check statuses in the cloud console or via CLI: 'aws route53 list-health-checks'.
If a weight is set to zero, that endpoint receives no traffic, which may be intentional for maintenance but can be confusing if forgotten. DNS caching also masks changes: clients may still hit old IPs until TTL expires. An admin might change weights but observe no immediate effect because resolvers are caching.
This is a classic exam trap: the answer is to reduce TTL before making changes or wait for cache expiration. Another issue is overlapping record sets with same name but different routing policies; Route 53 picks one policy, not both. If a weighted record has the same name as an alias record, the behavior is undefined.
Exam questions often ask why a new weight is not taking effect-answer could be that the TTL is too long or that a health check is failing. When using weighted routing with multiple values, the DNS response may include all records, and the client picks one; if weights are misbalanced, it may still cause uneven load. For load balancer weight issues, incorrect weight values (e.
g., negative numbers out of range) cause errors; AWS only accepts 0-1000 for ALB target weights. In the A+ or Security+ exams, you might have to interpret logs where a load balancer reports 'weighted distribution anomaly'.
The root cause could be a target that is not draining connections properly, causing uneven load. To diagnose, use cloud watch metrics like 'RequestCountPerTarget'. For network devices, weighted routing misconfiguration can lead to suboptimal traffic flow; for example, in EIGRP, if the bandwidth statement is incorrect, the weight calculation gives a wrong metric, causing traffic to take a slower path.
The exam clue is to check interface bandwidth and delay settings. Finally, in disaster recovery scenarios like active-passive setups, weighted routing can be used to send a small percentage of traffic to a secondary site for validation. If the secondary site is misconfigured, those users face errors.
Troubleshooting involves reviewing health checks and access logs. All these issues are common in AWS-SAA, Google-ACE, and CompTIA exams, requiring you to think about both deterministic and probabilistic behavior.
Troubleshooting Clues
Traffic distribution does not match weight ratios after many requests
Symptom: After thousands of requests, one endpoint receives 55% instead of expected 50% for equal weights.
Weighted routing is probabilistic; distributions converge to the ratio over a large sample, but short-term variance is normal.
Exam clue: Exam questions often present this as a false alarm; the correct answer is that this is expected behavior, not a bug.
All traffic goes to a single endpoint after health check failure
Symptom: Monitored requests show 100% traffic to Server B even though weights are set evenly for A and B.
In Route 53 or ALB, health checks fail for one endpoint; its weight is effectively ignored, and all traffic goes to healthy endpoints.
Exam clue: Troubleshooting step is to check health check status; exam scenarios test that failover due to health check is automatic.
Weight changes not taking effect after update
Symptom: Engineer changed weight from 50 to 100 but still sees old distribution after 10 minutes.
DNS resolvers cache records for the TTL value (e.g., 300 seconds). Changes are only visible after TTL expires.
Exam clue: Classic AWS-SAA trap: reduce TTL before making weight changes to speed up propagation, or wait for cache to clear.
One endpoint receives zero traffic despite positive weight
Symptom: Weight set to 10 on a server, but logs show zero requests reaching it for hours.
Check if the weight is set to 0 accidentally, or if DNS queries return other records due to client random selection in multi-value answers.
Exam clue: Verify weight value in console; if zero, no traffic is routed. Also check for overlapping record sets that may override.
Load balancer target groups unbalanced after scaling
Symptom: After adding a new instance with weight 50, existing instances (weight 100 each) still get most traffic.
Weights in ALB are relative; new instance with 50 will receive less traffic than 100-weight instances. To balance, adjust all weights.
Exam clue: CCNA and AWS-SAA ask about scaling with weights; you must recalculate distribution to maintain intended ratios.
Traffic fails over to wrong region during DR test
Symptom: In a multi-Region setup with weighted records, primary region health check fails but traffic goes to unexpected secondary.
Weighted records with failover policy route based on both weight and failover type; misconfigured health check ID leads to wrong routing.
Exam clue: In exam, check that health check IDs are correctly associated and that the secondary record has a weight and is configured as failover secondary.
EIGRP path selection not using expected weighted metric
Symptom: Router prefers a path with lower bandwidth even though higher bandwidth is available, contrary to expected weight.
EIGRP metric calculation uses K values; default includes bandwidth and delay. Misconfigured K values or interface delay causes unexpected weight.
Exam clue: CCNA exams test that changing the delay or bandwidth on an interface directly affects the weighted EIGRP metric.
Weighted routing in Cloud DNS returns all records to client
Symptom: Clients receive both IP addresses in DNS response instead of one, leading to uneven load.
Google Cloud's weighted round-robin returns all records, and client picks one randomly; weights influence probability but not deterministic selection.
Exam clue: Google ACE exam may test that client-side randomness can cause imbalance; use TTL and monitoring to adjust.
Memory Tip
Think of weight like pizza slices: total slices = sum of all weights; each server gets slices proportional to its weight, not a fixed number.
Learn This Topic Fully
This glossary page explains what Weighted routing means. For a complete lesson with labs and practice, see the topic guide.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
SY0-701CompTIA Security+ →200-301Cisco CCNA →N10-009CompTIA Network+ →AZ-104AZ-104 →ACEGoogle ACE →SAA-C03SAA-C03 →220-1101CompTIA A+ Core 1 →220-1102CompTIA A+ Core 2 →SC-900SC-900 →SOA-C02SOA-C02 →PCAGoogle PCA →CDLGoogle CDL →ISC2 CCISC2 CC →Related Glossary Terms
An Alias record is a DNS record type that maps a hostname to another hostname, seamlessly routing traffic to AWS resources like load balancers or CloudFront distributions.
Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency and high transfer speeds.
AWS Direct Connect is a cloud service that lets you create a dedicated private network link from your on-premises data center to AWS, bypassing the public internet for more consistent and secure connectivity.
Failover routing is a network design that automatically redirects traffic to a backup path when the primary path fails, keeping services available.
A gateway endpoint is a networking component that acts as an entry and exit point for traffic between two different networks, typically translating between incompatible protocols or addressing schemes.
A hosted zone is a container for DNS records that holds the information needed to route internet traffic for a domain name.
Quick Knowledge Check
1.A company uses AWS Route 53 weighted routing to distribute traffic between two versions of an application. Version 1 has weight 10, Version 2 has weight 30. After 1000 DNS queries, Version 2 received 800 queries. What is the most likely explanation?
2.An administrator updates a Route 53 weighted record's weight from 50 to 100, but after 5 minutes, DNS queries still go to the old weight ratio. Which action should the administrator take?
3.In AWS ALB weighted target groups, what happens if one target has a weight of 0 and all other targets have positive weights?
4.A network engineer set up two static default routes to different ISPs with administrative distances 5 and 10. How is traffic distributed?
5.During a canary deployment, a team sets two Route 53 weighted records: new version weight 1, old version weight 99. After implementing, the new version receives 10% of traffic instead of 1%. What could be the cause?