Canary and Shadow-Traffic Comparison
Parent: MongoDB Performance Regression Detection and Testing Methodology · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-a0a420b316d1
↓ Facts as markdown↓ Portable .llms packagent context libraries
Source-anchored research for Canary and Shadow-Traffic Comparison. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Definitions
- Shadow traffic is not automatically side-effect-free. Mirrored requests can be processed twice, so an idempotent application is needed when requests must only be processed once, and shared state such as a cache between canary and production can inflate the cache hit rate and invalidate performance measurements. Sources: https://aws.amazon.com/blogs/networking-and-content-delivery/mirror-production-traffic-to-test-environment-with-vpc-traffic-mirroring/ ; https://sre.google/workbook/canarying-releases/ [source 1] [source 2]
How it works
- A canary routes a controlled share of production traffic to a changed version while the control serves the rest. Users in the canary slice receive candidate responses, so defects can affect that slice; teams compare candidate and control signals and can stop or roll back when the candidate regresses. (high confidence) [source 1] [source 2] [source 3]
- AWS VPC Traffic Mirroring is not zero-impact in every case: mirrored traffic counts toward the source instance's bandwidth, and mirrored traffic is dropped when the instance's bandwidth or packet-per-second limits are exceeded (production traffic is prioritized, but is also dropped if it alone keeps exceeding the limits). The AWS blog's statement that VPC Traffic Mirroring replicates traffic out-of-band with no performance impact describes that blog's out-of-band design, and the limitations page shows the instance-level caveats. Sources: https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-network-limitations.html ; https://aws.amazon.com/blogs/networking-and-content-delivery/mirror-production-traffic-to-test-environment-with-vpc-traffic-mirroring/ [source 1] [source 2]
Problems, failure modes and limitations
- Shadow runs replay production requests to the new version, but the client receives responses only from the base version and the new version's responses are discarded. Replayed state-changing requests can duplicate effects, so AWS notes an idempotent application is needed when requests must only be processed once. Sources: https://aws.amazon.com/blogs/networking-and-content-delivery/mirror-production-traffic-to-test-environment-with-vpc-traffic-mirroring/ [source 1] [source 2]
Comparisons and alternatives
- In Envoy v1.36.11, RequestMirrorPolicy mirrors all requests when runtime_fraction is unset and can restrict mirroring to a configured fraction when it is set. Sampling can limit candidate load, with the trade-off that fewer requests are measured. (low confidence) (verified as of 2026-10-01) [source]
Facts and statements
- A canary routes a portion of live requests to a candidate, so some users receive candidate responses; shadow traffic copies production requests to the candidate while the incumbent serves the client and the shadow response is discarded. (high confidence) [source 1] [source 2]
- A useful canary comparison uses a baseline running the production version and configuration, created alongside the candidate; match deployment time, instance count, traffic type, and traffic amount. Comparing against long-running production can confound results through cache warmup, heap, or load-balancing differences. (high confidence) [source 1] [source 2]
- Canary analysis should compare configured baseline and candidate time-series metrics that represent service health, including latency, errors, and saturation. Netflix's Kayenta description validates and cleans metric data, classifies individual metrics, and aggregates results; it describes Mann–Whitney U confidence intervals as its primary comparison algorithm. (high confidence) (verified as of 2018-04-10) [source 1] [source 2] [source 3]
- Google and Waze recommend validating a canary analysis configuration with known-good and known-bad app versions, and running an A/A check with the same version on both sides that should pass. (low confidence) [source]
- Google and Waze's Spinnaker guidance recommends at least 50 time-series data points per metric for statistically relevant canary analysis; depending on monitoring granularity, this can require several hours of analysis. (low confidence) (verified as of 2019-01-14) [source]
- With traffic mirroring, all requests are routed to the base version and replayed to the new version; the client receives responses only from the base version and the new version's responses are discarded. In Envoy's implementation, shadowing is fire and forget: Envoy does not wait for the shadow cluster to respond before returning the primary cluster's response. Sources: https://aws.amazon.com/blogs/networking-and-content-delivery/mirror-production-traffic-to-test-environment-with-vpc-traffic-mirroring/ ; https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto [source 1] [source 2] [source 3] [source 4]
- Canary metrics should be broken down by candidate and control population, and their aggregation intervals should fit within the canary duration. Service-wide metrics can dilute a regression affecting a small traffic slice, while a time window longer than the canary can mix unrelated events into the comparison. (high confidence) [source 1] [source 2]
Children
- No children recorded.