Inferensys

Glossary

Canary Deployment

A deployment strategy where a new model version is rolled out to a small subset of production traffic to validate performance and stability before a full-scale rollout.
ML engineer managing model versions on laptop, version history visible, technical Git-like workflow.
PROGRESSIVE DELIVERY STRATEGY

What is Canary Deployment?

A canary deployment is a risk-mitigation strategy for releasing new machine learning models by routing a small fraction of live production traffic to the new version to validate its stability and performance before a full-scale rollout.

Canary deployment is a progressive delivery technique where a new model version is deployed alongside the existing stable version, but only receives a small, controlled percentage of production inference requests. This allows infrastructure engineers to monitor critical metrics like prediction latency, P99 latency, error rates, and prediction drift in a live environment without impacting the entire user base. If the canary model violates a predefined Service Level Objective (SLO), traffic is immediately rolled back to the stable version.

The strategy relies on the serving infrastructure's ability to perform traffic splitting at the load balancer or service mesh level, directing a configurable subset of requests to the canary endpoint. Observability tooling continuously compares the canary's performance against the stable baseline. Once the canary demonstrates parity over a sufficient observation window, the rollout progresses incrementally until it handles 100% of traffic, at which point the old version is decommissioned.

PROGRESSIVE DELIVERY

Key Characteristics of Canary Deployments

Canary deployment is a risk-mitigation strategy that routes a small fraction of live production traffic to a new model version, enabling real-world validation of performance, latency, and stability before a full-scale rollout.

01

Traffic Splitting Mechanism

The core of a canary deployment is the traffic splitting layer, typically implemented in a service mesh like Istio or an API gateway. A small, configurable percentage of incoming inference requests—often starting at 5%—is routed to the new model version, while the remaining traffic continues to the stable baseline. This is achieved through weighted routing rules that operate at the application layer (Layer 7), allowing for granular control based on headers, cookies, or user segments. The split is dynamic and can be adjusted incrementally without redeploying the infrastructure.

02

Real-Time Metric Validation

During a canary, the new model's behavior is continuously compared against the baseline using a defined set of Service Level Indicators (SLIs). Critical metrics include:

  • Prediction Latency: P50, P95, and P99 response times must not degrade.
  • Error Rate: The percentage of 5xx or 4xx responses must remain within the Error Budget.
  • Model-Specific Metrics: For recommender systems, this includes Click-Through Rate (CTR) and ranking quality; for generative models, it includes token-level perplexity or toxicity scores.
  • Resource Utilization: CPU, GPU memory, and network I/O are monitored to detect regressions in computational efficiency.
03

Automated Rollback Triggers

A manual canary is a monitoring exercise; an automated canary is a safety net. Integration with observability platforms like Prometheus and Grafana allows for the definition of automated rollback triggers. If the canary version violates a critical Service Level Objective (SLO)—for instance, if the P99 latency exceeds 200ms or the error rate surpasses 0.1% for a sustained 5-minute window—the traffic split is automatically reverted to 100% baseline. This is often orchestrated by a Continuous Delivery tool like Argo Rollouts or Spinnaker, which executes the rollback without operator intervention.

04

Session Affinity Requirements

For stateful or user-specific personalization, session affinity (sticky sessions) is critical during a canary. A user routed to the canary model must continue to be served by that same version for the duration of their session to ensure a consistent experience. Without it, a user could receive a product recommendation from the new model on one page load and the old model on the next, corrupting the A/B test data and causing a disjointed user experience. This is typically configured via a cookie or header-based routing rule in the ingress controller.

05

Statistical Significance Analysis

A canary deployment is fundamentally an online controlled experiment. The traffic split must run long enough to achieve statistical significance in the observed metrics. This requires a pre-calculated sample size based on the expected effect size and baseline variance. Running a canary for too short a period risks a false positive (shipping a regressive model), while running it too long delays value delivery. Advanced systems integrate with experimentation platforms that perform sequential probability ratio testing (SPRT) to determine when a metric has reached a conclusive result, allowing for an early, data-driven promotion or rollback.

06

Shadow Mode vs. Live Traffic

A canary deployment differs from a shadow deployment. In shadow mode, the new model receives a copy of 100% of live traffic, but its responses are discarded and never returned to users. This allows for performance testing under full production load without any user impact. A canary, in contrast, exposes real users to the new model's output, making it a test of both technical performance and business metrics like conversion rate. A robust progressive delivery pipeline often uses shadowing first to validate latency and resource usage, followed by a canary to validate user-facing metrics.

CANARY DEPLOYMENT STRATEGY

Frequently Asked Questions

Explore the critical operational patterns and infrastructure considerations for safely rolling out new model versions in high-stakes, low-latency production environments.

A canary deployment is a risk-mitigation strategy where a new version of a machine learning model is released to a small, controlled subset of production traffic before a full-scale rollout. The process begins by deploying the new model variant alongside the existing stable version. A traffic-splitting mechanism—typically a reverse proxy, service mesh like Istio, or an API gateway—routes a small percentage of live inference requests to the canary instance. Engineers then monitor a defined set of metrics, including prediction latency, P99 latency, error rates, and business KPIs like click-through rate, for a predetermined bake period. If the canary's performance meets the defined Service Level Objectives (SLOs) and shows no regression compared to the baseline, the traffic percentage is incrementally increased until the canary serves 100% of requests, at which point the old version is decommissioned. If anomalies are detected, the traffic is immediately rolled back to the stable version, limiting the blast radius of a bad deployment to a tiny fraction of users.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.