Load Balancing and Traffic Management Questions
Distributing requests across capacity: load-balancing algorithms (round-robin, least-connections, consistent hashing), L4 versus L7 balancing, health checks, and traffic shaping. Covers sticky sessions, canary and blue-green routing, rate limiting, and graceful draining. The traffic-distribution layer that keeps a scaled system balanced and available.
Design a prioritization mechanism at the load balancer so critical transactions (for example payments) keep getting served when the system is under overload while lower-priority traffic gets shed first. Cover request classification, queueing, and how you'd enforce this consistently across a fleet of distributed load balancers.
Sample Answer
Direct answer
Protect payment traffic under overload by classifying every request into a priority class as early as possible (at ingress, before queueing), giving each class a guaranteed floor of capacity enforced through per-class token buckets or weighted fair queueing, and pushing that same weight configuration to every load balancer in the fleet from one control plane so the guarantee holds no matter which node a request lands on. Lower-priority traffic is shed first because it is the only class allowed to fall below its floor; payments keep their floor even when total demand is double the fleet's capacity.
Structured elaboration
- Classification. Tag each request with a priority class (High: payments, Medium: interactive, Low: background/batch) using cheap, already-available signals: route or endpoint, a signed claim in the auth token, or a tenant-tier lookup. Attach the class as internal metadata immediately, before the request enters any queue, so every downstream decision (queueing, shedding, logging) uses one consistent label.
- Queueing. Maintain one queue per class and use weighted fair queueing (WFQ) to drain them, where each class has a configured weight (its guaranteed floor share of total throughput) and unused floor from one class can be borrowed by others that still have demand. This is what keeps a quiet payments path from wasting capacity while a busy interactive path is starved.
- Enforcement placement: edge versus central. Enforce token-bucket admission at the edge, on each load balancer node, using locally cached weights, not with a synchronous call to a central limiter on every request; a central check on the request path adds latency to exactly the premium, low-latency traffic this design is trying to protect. The control plane's job is to compute and distribute weights, not to sit in the hot path.
- Fleet-wide consistency. A central policy service holds the source-of-truth weights and tenant SLAs and pushes them to every load balancer node (streaming or periodic pull with a version number). Each node enforces locally against its own share of traffic; because the weights are ratios, not absolute counts, consistent enforcement does not require nodes to share live counters, only to agree on the same weight configuration.
graph LR
Req[Incoming request] --> Classify[Classify: route/claims/tenant tier]
Classify --> High[High queue: payments]
Classify --> Med[Medium queue: interactive]
Classify --> Low[Low queue: background]
High --> WFQ[Weighted fair queue, local weights]
Med --> WFQ
Low --> WFQ
WFQ --> Backend[Backend pool]
Control[Control plane: SLA weights] -.push versioned weights.-> WFQ
Control -.push versioned weights.-> Peer[Other LB nodes]
Worked example
A fleet's pooled capacity is 1,000 requests/second, split into guaranteed floors of High 50% (500 rps), Medium 30% (300 rps), Low 20% (200 rps). Demand arrives at High 400 rps, Medium 900 rps, Low 700 rps, a combined 2,000 rps, twice the fleet's capacity.
Step 1, serve each class up to the smaller of its demand or its floor:
High=min(400,500)=400,Medium=min(900,300)=300,Low=min(700,200)=200That uses 900 rps, leaving 100 rps of capacity unused, entirely from High's unclaimed floor (500−400=100).
Step 2, redistribute that 100 rps to the classes still short of their demand, in proportion to their configured weights (Medium 30, Low 20, ratio 3:2):
Medium extra=100×53=60,Low extra=100×52=40Final allocation: High 400 (100% of demand served, 0% shed), Medium 300+60=360 out of 900 demanded (540/900=60% shed), Low 200+40=240 out of 700 demanded (460/700≈65.7% shed). The three allocations sum to exactly 1,000, the fleet's full capacity, and payments never lose a request despite the 2x overload.
Trade-offs & pitfalls
- Enforcing at the edge with locally cached weights avoids adding a synchronous hop to premium traffic, but it means weight updates are eventually consistent across the fleet; use a short propagation target and treat "every node agrees" as a monitored invariant, not an assumption.
- Soft preemption (stop admitting new low-priority work) is safer than hard preemption (killing in-flight low-priority requests) because it does not risk half-completed side effects; reserve hard preemption for genuine emergencies with an explicit circuit breaker, not as the default overload response.
- Common wrong turn: sizing floors only from traffic mix under normal load. Floors need to hold under the worst realistic overload ratio, which is exactly when they matter; a floor that looks generous at 1x load can still starve payments at 3x load if it was never tested against it.
- Immutable, per-decision audit logs (class, weight version, admit or shed) are what let you prove the guarantee held during an incident, not just that the policy was configured correctly.
Design the load balancing and routing components that support canary and blue-green deployments: weighted traffic routing, a ramp-up schedule, and health-based rollback triggers. What are the respective responsibilities of the load balancer, the API gateway, the CI/CD pipeline, and the monitoring system?
Sample Answer
Direct answer
The load balancer or gateway owns the mechanics of splitting traffic by weight, which is how canary works (gradually shifting a percentage of traffic to a new version to validate it before a full rollout), and, for blue-green (keeping old and new versions both fully deployed and cutting all traffic over in one atomic step), the atomic cutover; the CI/CD pipeline owns the ramp schedule and issues the weight changes, and monitoring owns the go/no-go signal. None of them should hold that logic exclusively, since a rollback has to be as fast as a single API call, not a redeploy.
Architecture and responsibilities
flowchart LR
Client --> GLB[Global LB]
GLB --> GW[API Gateway]
GW -->|weighted split| V1[Service v1: stable]
GW -->|weighted split| V2[Service v2: canary]
CICD[CI/CD pipeline] -->|updates weights| GW
CICD -->|deploys| V2
Mon[Monitoring / SLO check] -->|health signal| CICD
Mon -->|watches| V1
Mon -->|watches| V2
| Component | Owns |
|---|---|
| Load balancer (L4/global) | Region/AZ-level failover, coarse blue/green cutover (flip an entire environment's traffic atomically), TLS termination |
| API gateway / service mesh | Fine-grained weighted routing (1% -> 5% -> 25% ...), header/cookie-based routing for sticky test cohorts, an admin API to change weights instantly |
| CI/CD pipeline | Defines the ramp schedule, deploys the canary version, calls the gateway's weight API at each stage, runs smoke tests between stages, triggers rollback |
| Monitoring/SLO evaluator | Compares canary vs baseline on the same metrics (error rate, p99 latency) tagged by version, evaluates rollback thresholds, emits the signal CI/CD acts on |
Worked example: ramping up without invalidating your cache
If the canary is chosen by a plain modulo hash of the request key (e.g. user ID mod N), changing the number of "buckets" that map to the canary remaps close to the entire keyspace every time the weight changes, which for any service with per-user cache locality (session affinity, warm connection pools, an edge cache keyed by user) means a near-total cache flush at every ramp step.
With a consistent-hash ring instead, moving weight Δ (as a fraction of the ring) into or out of a node remaps approximately Δ of the keyspace, no more. Given the ramp schedule 1% -> 5% -> 25% -> 50% -> 100%, the weight delta at each step is:
Δ1=5%−1%=4%,Δ2=25%−5%=20%,Δ3=50%−25%=25%,Δ4=100%−50%=50%so at the first ramp step only about 4% of keys move onto the canary arc, leaving the other 96% (and their caches, warm connections, and session state) untouched; at the second step only another 20% moves, and so on. At no point does a step touch more of the keyspace than its own Δ.
A concrete rollback threshold for the monitoring/SLO evaluator, tied to this same ramp schedule: at each step (1%, 5%, 25%, 50%), automatically roll back if the canary's error rate exceeds 2x the stable baseline for any 60-second window, or if canary p99 latency exceeds baseline p99 by more than 50ms for 3 consecutive 30-second checks (sustained across at least 90 seconds, not a single noisy sample). Whichever condition trips first calls the gateway's weight API to set the canary's weight back to 0% and hold the stable version at 100%, rather than waiting on a human to notice.
Trade-offs and pitfalls
- Time-based ramps are simpler to build but blind: a metric-driven ramp (only advance if error rate and p99 stay within a defined band of baseline) is safer but requires the monitoring system to be fast and reliable enough to gate on, which becomes its own dependency to get right.
- Blue-green's instant, atomic cutover is faster to roll back than a gradual canary but exposes 100% of traffic to any bug that only surfaces at full load or after a longer soak time; canary trades that risk for a slower rollout.
- Database and schema compatibility is the trap traffic-layer design alone can't solve: v1 and v2 must both be able to read and write whatever schema is live during the entire overlap window, so this design assumes backward/forward-compatible migrations are handled separately.
- Session affinity and canary interact badly if not designed together: a user pinned to the canary by a sticky cookie who then gets rolled back mid-session needs a defined fallback (drop the cookie, revalidate), or they end up stuck talking to a version that no longer exists.
- Keep rollout state (current weights, stage, thresholds) in version control (GitOps: treating a git repository, not a live dashboard, as the source of truth for infrastructure state, so every change is a reviewable commit) rather than only in the gateway's live config, so a rollback is auditable and reproducible, not just fast.
Design a global per-user rate limiter that enforces limits across multiple datacenters and load balancers with low latency. Compare a centralized token-bucket store, distributed counters, and probabilistic sketches for correctness under network partitions, and explain how you would shard user keys and gracefully degrade if the rate-limiting store becomes unavailable.
Sample Answer
Direct Answer
Enforce limits locally at the edge with a fast in-memory bucket, and reconcile that local state against a global store periodically rather than checking the global store on every request. Which algorithm backs the global side depends on how much overshoot is acceptable: a centralized token bucket (a counter that holds a capped number of request "tokens", drains one per allowed request, and refills at a steady rate, enforcing both a sustained rate and a bounded burst) gives exact enforcement but adds cross-region latency and a single dependency, distributed counters trade a bounded, quantifiable overshoot for availability, and probabilistic sketches trade a small one-directional error rate for handling very large key cardinalities cheaply. Almost every production global limiter ends up as a hybrid of local enforcement plus asynchronous global reconciliation, with a documented, bounded degradation path for when the global store is unreachable.
Architecture
flowchart LR
Client --> EdgeA[Edge Gateway - Region A]
Client --> EdgeB[Edge Gateway - Region B]
EdgeA -->|async sync| GlobalStore[(Global Store, quorum)]
EdgeB -->|async sync| GlobalStore
GlobalStore --> Reconciler[Reconciliation Job]
Reconciler -->|adjust local cap| EdgeA
Reconciler -->|adjust local cap| EdgeB
EdgeA -.fail open.-> LocalCap[Conservative Local Cap]
EdgeB -.fail open.-> LocalCap
Each edge gateway enforces a local token bucket immediately (no cross-region round trip on the request path) and asynchronously syncs its counts to the global store. The reconciliation job periodically redistributes each user's remaining global budget across the regions currently seeing their traffic. If the global store is unreachable, each edge gateway falls back to a conservative local cap rather than allowing unlimited traffic.
Comparing the Three Approaches
| Approach | Correctness under partition | Latency | High-cardinality / heterogeneous keys | Operational complexity |
|---|---|---|---|---|
| Centralized token bucket | Exact while reachable; unavailable or stale during a partition (needs a quorum, a majority of nodes agreeing before a write is accepted, or a single leader node coordinating writes) | Adds a cross-region round trip per check unless heavily cached | Fine for moderate key counts; every distinct user needs a stored counter | Moderate: one authoritative store to scale and keep available |
| Distributed counters (local buckets + periodic sync, e.g. CRDT-style counters, data structures designed so independent updates from different nodes can be merged automatically without conflicts) | Eventually consistent; overshoot is bounded by the sync interval times the max local rate during a partition | Low, since checks are local | Scales well; each shard only tracks its local users | Higher: needs merge/reconciliation logic and monitoring for sync lag |
| Probabilistic sketch (e.g. count-min sketch) | Approximate always, not just under partition; error is one-directional (can only overcount, never undercount, due to hash collisions) | Very low, fixed memory regardless of key count | Best for very high cardinality (millions of distinct keys) where per-key storage isn't affordable | Lower operationally, but not appropriate as the source of truth for a billed quota because of the overcount bias |
Sharding User Keys
Route a given user's traffic to a small, bounded set of enforcement points via consistent hashing on the user key, rather than letting it fan out across the whole fleet. This does two things: it keeps the local-bucket state for one user concentrated on a few nodes (so local enforcement is actually meaningful), and it bounds the worst case for the fail-open fallback, shown concretely below.
Worked Example: Sizing the Fail-Open Cap Correctly
Say the intended global limit is 600 requests/minute per user. The naive fail-open formula is often stated as:
per-node cap=Nactive nodesglobal rateThe critical detail is what Nactive nodes should mean. It is not the size of the whole fleet, it is the number of distinct enforcement points a single user's traffic can concurrently reach.
Correct sizing. Suppose user keys are consistent-hashed to exactly R=3 regions (a primary plus two fallbacks). The fail-open cap per region:
3600=200 req/min per regionIf the global store is fully partitioned and the user simultaneously maxes out all 3 reachable regions, the worst-case total is:
3×200=600 req/minexactly the intended global bound, with zero overshoot, even during a total global-store outage.
Incorrect sizing. If instead the fail-open cap is naively divided across the entire fleet of, say, F=50 edge nodes:
50600=12 req/min per nodeA user who (via the consistent-hash routing above) only ever actually reaches 3 of those 50 nodes would be capped at 3×12=36 req/min during a partition, a needless 16.7x under-enforcement relative to their intended 600 req/min limit. The fail-open denominator has to match the real fan-out bound, not the fleet size, or the fallback cap is simply wrong in one direction or the other.
Burst Tolerance and Tiered Limits
Sizing burst capacity. A token bucket has two parameters: a steady refill rate and a burst capacity (the bucket size). The refill rate enforces the sustained limit; the burst capacity is what lets a legitimate spike (a page loading several resources at once, a client retrying after a transient error) through without being throttled, while still bounding how long an abusive client can sustain a rate above the steady limit.
Using the same numbers as the fail-open example above: the global sustained rate is 600 req/min, which is
60600=10 req/secand with R=3 shards reachable per user, each shard's steady refill rate is
310≈3.33 req/secmatching the 200 req/min per-shard cap used earlier (200/60≈3.33). Pick a burst window that covers a realistic legitimate spike, for example 5 seconds. Per-shard burst capacity is then
3.33×5≈16.67→16 tokensrounded down, not up, so the fallback stays conservative. A client can spend all 16 tokens instantly, then is limited back to the 3.33 tokens/sec refill. If a user's traffic hits all 3 reachable shards simultaneously, the worst-case instantaneous burst is 16×3=48 tokens, about 4.8 seconds of full-rate traffic, after which the steady 600 req/min bound reasserts itself. This is what separates burst tolerance from opening the door to sustained abuse: the extra capacity is bounded and one-time, not an increase to the refill rate.
Composing tiered limits. Real deployments usually layer more than one scope: per-API-key, per-tenant (an account holding several keys), and a fleet-wide global tier. The composition rule is that the most specific tier is evaluated first, since it is the cheapest single-bucket check and the one most likely to reject, so a request fails fast before spending work on broader tiers. A request is admitted only if it passes every applicable tier; failing any one of them throttles the request regardless of how much headroom it has in the others.
Concretely, extending the per-key figure used throughout: suppose a tenant owns 5 API keys, each individually capped at 600 req/min. The naive sum of those keys' allowances is 5×600=3000 req/min. A per-tenant tier deliberately caps below that naive sum, for example at 80%:
3000×0.8=2400 req/minso no single tenant can claim the full linear sum of its keys, leaving fairness headroom for other tenants sharing the same shard. The global tier sits above both: it is the same fleet-wide store from the architecture above, sized to actual infrastructure capacity rather than to any per-tenant math, and it throttles across every tenant once aggregate traffic approaches that capacity, independent of whether any individual key or tenant is within its own limit. That is why the global tier is the backstop: it is checked last, and it is the only tier tied to real capacity rather than to a customer-facing contract.
Trade-offs and Pitfalls
- Reconciliation after a partition heals needs to avoid double-counting requests that local buckets already allowed independently in each region; the reconciliation job should read each region's already-consumed count and merge, not replay raw request logs.
- Fixed time windows are vulnerable to clock skew across regions; a sliding-window or log-based approach avoids the skew problem at the cost of more memory per key, and is worth it specifically for the regions where you can't guarantee tight NTP sync.
- Whether to fail open or fail closed when the global store is unreachable depends on what the limiter protects: availability-oriented read paths usually fail open with a conservative bound (as above), while abuse- or cost-critical paths (e.g., a paid external API call per request) more often fail closed, accepting some availability loss to avoid an unbounded cost blow-up.
- A probabilistic sketch's overcount-only error means it can occasionally throttle a fully compliant user due to a hash collision with a heavy user; that is a real user-facing failure mode, not just a theoretical one, and is the reason sketches are used for cheap high-cardinality abuse mitigation rather than as the record of truth for a customer's contracted quota.
Design an automated control loop that shifts a percentage of production traffic to a canary over a fixed window and rolls back automatically on an SLO breach. Cover how you would smooth the weight changes, what guardrails you'd set (minimum observation windows, maximum error thresholds), and how the rollback itself executes quickly and safely.
Sample Answer
Direct answer
An automated canary control loop is a periodic process that increases a canary's traffic weight in small, guarded steps, checks health metrics against the baseline after every step using a minimum-observation window, and holds or immediately rolls back to zero on an SLO breach (a violation of the service-level objective, the reliability target you've committed to, such as 99.9% success rate). The design problem is really about the guardrails and the rollback path, not the ramp itself.
Structured elaboration
Components:
- A traffic router (Envoy, an ingress controller, or a cloud LB) that supports weighted routing and an instant weight-update API.
- A telemetry pipeline producing short and long rolling windows of error rate, latency, and request volume, split by canary vs. baseline.
- A stateless controller that runs the step/check/decide loop and calls the router's weight API.
- A rollback path that can zero out canary weight immediately, independent of the step loop.
Guardrails (the part that actually matters):
| Guardrail | Purpose | Example setting |
|---|---|---|
| Minimum observation window | Prevents decisions on too little data | require >= 100 canary requests in the last 60s before advancing |
| Short window (fast signal) | Catches sharp regressions quickly | 60s rolling window |
| Long window (stability) | Filters transient noise, confirms sustained breach | 300s rolling window |
| Max error delta | Hard stop on quality regression | canary error rate > baseline + 0.5 pp |
| Max latency ratio | Hard stop on tail-latency regression | canary p99 > baseline p99 x 1.2 |
| Monotonic ramp | Never sneak weight back up after a hold | only increase, decrease only via rollback |
| Cooldown after rollback | Prevents a flapping loop from re-triggering immediately | 30 minute freeze + incident ticket |
Smoothing the weight changes. Compute a fixed step size from the target ramp, then apply the step in small sub-increments at the router level (e.g. over a few seconds) so a single jump doesn't itself cause a connection-pool or cache-warming spike.
Worked example
Target: shift 10% of production traffic to canary over a 10 minute (600s) window, checking every 30s.
steps=30s600s=20 step size=2010%=0.5% per stepSo the loop runs 20 times, adding 0.5 percentage points of canary weight each pass, provided the guardrails above all pass. If step 12 (weight = 6%) shows canary p99 = 340ms against a baseline p99 of 260ms:
260340≈1.31>1.2That exceeds the 1.2x latency-ratio guardrail, so the controller does not advance to step 13. It instead sets weight back to 0% immediately (not a gradual decrease), opens an incident, and freezes further attempts for the cooldown period.
# runs every 30s
current = get_current_weight()
target = min(10, current + 0.5)
m = fetch_metrics(short=60, long=300)
if m.canary_requests_short < 100:
return # not enough signal yet, hold at current weight
if m.error_rate_canary > m.error_rate_baseline + 0.005 or \
m.p99_canary_long > m.p99_baseline_long * 1.2:
set_weight(0) # immediate rollback, not gradual
open_incident(m)
start_cooldown(minutes=30)
else:
set_weight(target) # router ramps this smoothly over a few seconds
Extensions: downstream capacity and CI/CD integration
Downstream-capacity-constrained ramp. The guardrails above are all canary-side (error rate, latency). A canary can look perfectly healthy on its own metrics while the traffic it forwards saturates a downstream dependency, a connection pool, a queue, or a rate-limited third-party API, before that dependency's own health signal even reflects the problem. Add a downstream capacity ceiling as its own guardrail: before each step, check the downstream dependency's current utilization (connection-pool saturation, queue depth, or a published capacity headroom number) and cap the canary weight so its incremental load stays under that ceiling, independent of what the canary's own error and latency metrics say. In practice the step size becomes the smaller of the scheduled step and the downstream headroom divided by requests-per-weight-point, and downstream saturation becomes its own rollback trigger alongside the error and latency guardrails, since the canary's own SLOs will not catch a downstream problem until it is already failing.
CI/CD pipeline integration. The loop is usually not a standalone daemon, it is a stage in the deploy pipeline. A build that passes its test stage triggers the deploy, which starts the canary at 0% weight and hands control to this loop; the pipeline blocks promotion to the next stage (wider rollout, or the next environment) until the loop reports a verdict, not a fixed timer. On success the loop reports pass and the pipeline proceeds to full rollout. On a guardrail breach, the loop's immediate zero-weight rollback from the worked example above is reported back as a failed pipeline stage: the deploy is marked failed, the previous version stays serving at 100%, and the pipeline stops rather than continuing to the next stage. That makes the human's only manual step reviewing the failure, not remembering to check on the canary.
Trade-offs and pitfalls
- Short windows are noisy, long windows are slow. A short-only window trips on transient blips; a long-only window lets real regressions run for minutes before anyone notices. Using both, and requiring the long window to confirm, is the standard resolution.
- Rollback must never itself be a slow ramp. The instinct to "gradually" bring weight back down defeats the purpose; on breach, cut to zero immediately and investigate after.
- Minimum-request guardrails matter more for low-traffic services. A service doing 50 RPS total needs a longer observation window or a lower canary weight cap just to get statistically meaningful samples per step.
- Business metrics can lag system metrics. A checkout canary can look perfectly healthy on latency and error rate while conversion silently drops; if the metric that matters is business-level, it needs its own window and threshold, not just infra SLOs.
- This is inherently single-service. Running the same loop concurrently across many dependent services without coordination risks compounding partial failures across a call graph; large orgs typically centralize this into a shared canary-analysis service rather than one loop per team.
Compare active-active and active-passive architectures for making the load balancer layer itself highly available. Describe failure detection, how DNS and anycast fit into each approach, state-synchronization requirements, and the trade-offs in cost, complexity, and recovery time.
Sample Answer
Direct answer
Active-active runs multiple load balancers serving traffic simultaneously, giving near-instant failover since the survivors are already warm and already receiving traffic, at the cost of needing to handle state consistency across them. Active-passive keeps a standby idle until a failure is detected, which is operationally simpler and cheaper but has strictly worse recovery time, since the standby has to actually take over, not just absorb more of a load it was already serving.
Comparison
| Dimension | Active-active | Active-passive |
|---|---|---|
| Failure detection | Health checks and heartbeats among peers; a failed node's traffic share is redistributed to already-running peers | Heartbeat/cluster arbitration (e.g. VRRP, the Virtual Router Redundancy Protocol that lets a standby take over a shared virtual IP, or keepalived, a common Linux implementation of it) with quorum or fencing (forcibly cutting off a misbehaving node's power or network access so it truly can't serve) to avoid two nodes both believing they're primary (split-brain) |
| Role of DNS/Anycast | Anycast fits naturally: an identical IP announced from multiple active locations, the nearest healthy one wins at the routing layer | DNS failover (short TTL, single active record) is common; VRRP-style IP takeover is faster than DNS when both nodes share an L2 segment |
| State synchronization | Needs either stateless design or active replication (a shared session store, consistent hashing for locality), since more than one node is live at once | Simpler: only one node is authoritative at a time, replication to standby can be asynchronous since it isn't concurrently serving |
| Recovery time | Fast, often sub-second to a few seconds, since capacity is already running | Slower: bounded by detection time plus promotion time (VRRP takeover is quick, DNS-based failover is slow due to caching) |
| Cost | Higher: standby capacity isn't idle, it's paying its way as active capacity, but that means paying for redundancy at all times | Lower: standby sits idle until needed, but idle capacity is capacity you're paying for and not using day to day |
| Complexity | Higher: consistency, routing, and monitoring all have to account for concurrent writers/servers | Lower: one active path to reason about at a time; correct failover logic is the main thing that has to work |
When to choose which
Choose active-active when the recovery-time budget is tight (seconds, not minutes) and the service can either be made stateless at the LB layer or afford real-time state replication. Choose active-passive when the service's state is genuinely hard to keep consistent across concurrent writers, or when the cost of standing up full duplicate active capacity isn't justified by the actual availability requirement; a slightly slower failover is a legitimate trade-off, not a compromise, if the SLA allows for it.
Worked example
Take a 2-node pair using VRRP with a 1-second heartbeat and a 3-missed-heartbeat failure threshold. In active-passive, the standby only notices the active node is gone after 3×1s=3s of missed heartbeats, then needs roughly 1s more to take over the shared IP, so client-visible downtime is about 3+1=4s. In active-active with the same 3s detection window, the survivor is already serving traffic, so that window doesn't cause an outage, it just means the failed node's share has to shift over. If 10,000 RPS was split evenly across the pair (5,000 RPS each), the survivor's load roughly doubles to 10,000 RPS the moment the shift completes: active-active trades a ~4s outage for a ~4s capacity spike that the survivor must already be provisioned to absorb.
Trade-offs and pitfalls
- Split-brain is the active-passive failure mode that active-active sidesteps by construction, since there's no single "the" primary to disagree about; any active-passive design needs real fencing (forcibly cutting off a misbehaving node so it truly can't serve) or quorum, not just a heartbeat timeout, or a network partition can leave two nodes both serving as primary.
- Active-active's biggest hidden cost is usually not the LB layer itself but what's behind it: if the backends and session store aren't also built for concurrent multi-region writes, active-active load balancing in front of a single-writer database just moves the bottleneck, it doesn't remove it.
- DNS-based failover for active-passive is bounded by TTL in theory but by resolver and client caching behavior in practice; some clients and corporate resolvers ignore short TTLs, so don't treat a TTL setting as a guaranteed failover time.
- Testing failover regularly, not just designing for it, is what separates a working active-passive setup from one that fails silently the one time it's needed; an untested standby is a hypothesis, not a plan.
Unlock Full Question Bank
Get access to all Load Balancing and Traffic Management interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.