Scaling and headroom
Scaling is a reliability concern when capacity runs out: a spike, a zone loss, or a backlog drain after an outage can push a tier past its limit, and the flow fails even though nothing is broken. This page covers the reliability side of the Well-Architected checklist item RE:06 Design a reliable scaling strategy.
The demand side, meaning the planning envelope, the load shapes, and the capacity-test matrix, is owned by the capacity model. This page does not repeat it.
Four ways capacity fails
Zone-loss headroom
When one of three zones is lost, a zone-redundant tier keeps two thirds of its instances. Whether that is enough depends on how the tier scales.
| Tier type | Rule |
|---|---|
| Autoscaled and zone-redundant | The autoscale maximum MUST cover peak demand on two zones. The minimum MUST leave at least one instance in each remaining zone |
| Fixed size and zone-redundant | The fixed size SHOULD be about 1.5 times the peak need, so two zones carry the peak |
| Not zone-redundant | A zone loss can remove the whole tier. The gap is in the DR gap register |
| Serverless, scaled by the platform | Microsoft moves instances to healthy zones. Watch backlog during the move |
T0 tiers today
| Component | prd capacity | Zone-redundant | Headroom after a zone loss | Confidence |
|---|---|---|---|---|
| Application Gateway | Autoscale 2 to 10 capacity units, zones 1, 2, 3 | Yes | The maximum of 10 is not derived from the capacity model, and there is no capacity alert (Application Gateway capacity) | Verified |
| APIM | Standard, 2 units | No (DR-03) | A zone loss can take every unit | Verified |
| Service Bus | Premium, 1 messaging unit | Yes | Microsoft-managed. One unit carries every asynchronous flow. Utilization is not alerted (SC-04) | Verified |
| Incidents Function Apps | Linux Consumption, app_scale_limit 25 for messaging and 5 for HTTP | No, accepted (DR-12) | The scale controller replaces instances in healthy zones | Verified |
| Pigeon | P0v3, 2 workers, always_on | No (DR-11) | Unknown whether one worker carries the peak (SC-01) | Verified |
| Cosmos DB event stores | Zone-redundant accounts | Yes, except cosno-dprso (DR-07) | Microsoft-managed. Throughput is unchanged by a zone loss | Documented |
| Shell SignalR | Standard_S1, 1 unit | No (DR-09) | A zone loss drops every connection. MFEs keep working over REST with stale live views (no polling fallback, RT-02) | Verified |
Scale limits
A scale limit is a self-preservation control, not only a cost control. A
Function App that scales without a limit can overrun the store behind it: more
instances mean more concurrent writes to Cosmos DB or Azure SQL, more 429
responses, and a retry storm.
| Service | Limit | Protects |
|---|---|---|
boundedctx-incidents messaging | app_scale_limit 25 | Incidents event store and projections |
boundedctx-incidents HTTP | app_scale_limit 5 | Query load on Azure SQL |
| Phoenix | app_scale_limit 6 | Graph and the Pigeon queues |
| Pigeon | 2 fixed workers | Graph, Twilio, and email providers |
Rules:
- Every T0 and T1 compute tier MUST have an explicit maximum: a scale limit, an autoscale maximum, or a fixed size.
- The maximum SHOULD be derived from the capacity of the dependency behind it, and the derivation recorded in the service’s capacity budget (SC-05).
- Recovery work, such as replay, backfill, and DLQ reprocessing, MUST run in a rate-capped lane that cannot consume live-path headroom. This is the backfill rule in the capacity model.
Cold starts on T0 Consumption apps
The incidents Function Apps are T0 and run on Linux Consumption (Y1). After
an idle period, the first execution waits for an instance to start.
| Effect | Flow | Risk |
|---|---|---|
| The first incidents after a quiet period are appended later | FL-01, freshness under PERF-4 | Low: seconds against a 30-second target |
| The first Alya queries after a quiet period are slower | FL-03, view latency under PERF-2 | Medium: the HTTP app serves interactive users |
Cold starts are not measured (SC-02). The target hosting is Flex Consumption with always-ready instances and zone balancing, which the ADR-0017 amendment sets as the default for new Function Apps.
Quotas and service limits
Some limits cannot be fixed by scaling. They are failure points and MUST be known before they are hit.
| Limit | Where it bites | Monitored |
|---|---|---|
| Cosmos DB provisioned or autoscale maximum RU/s per container | Event-store writes during a burst or a replay | Throttling alerts in boundedctx-incidents |
| Service Bus Premium messaging-unit capacity | Every asynchronous flow | Not documented (SC-04) |
| Service Bus maximum message size | Oversize messages fail. See RES-14 | No |
| APIM unit capacity | Every portal | Not documented (SC-04) |
| Application Gateway maximum capacity units | Every hostname on the gateway | No capacity alert |
| SignalR connections per unit: 1,000 on Standard | Shell live updates | Not sized (SC-03) |
| Microsoft Graph throttling per app and tenant | Teams delivery and subscriptions (FL-02, FL-05) | Send failures only. No 429 handling (RES-03) |
| Twilio account call rate | Voice escalation during a burst | Call failure alert |
| ServiceNow API rate limits | Ticket creation during a burst | Ticket Creation Latency alert |
| Entra ID token issuance throttling | Every flow during a mass restart | Not documented |
Gaps
| ID | Severity | Gap | Fix | Owner |
|---|---|---|---|---|
| SC-01 | MEDIUM | Zone-loss headroom is not calculated for the fixed-size T0 tiers: APIM, Pigeon, and the single Service Bus messaging unit | Calculate peak need on two zones and size to it, as part of DR-03 and DR-11 | CPE, Pigeon team |
| SC-02 | MEDIUM | Cold starts on the T0 incidents Function Apps are not measured | Measure the first-request latency after idle. Move to Flex Consumption with always-ready instances when DR-12 is scheduled | Incidents team |
| SC-03 | MEDIUM | Shell SignalR has 1 unit, 1,000 connections, and is not sized against the M6 measurement in the capacity model | Measure concurrent connections and size the units, together with DR-09 | Alya shell BFF team |
| SC-04 | MEDIUM | No utilization alerts on the Service Bus messaging unit or APIM capacity | Alerts at 70 to 80% utilization, routed to SRE | CPE |
| SC-05 | LOW | Scale limits are not derived from the capacity of the dependency behind them, and the T0 capacity budgets are not filled in | Fill in the capacity budget for each T0 component | Owning teams |
The missing load test, which would show the first bottleneck on the T0 path, is tracked as RT-01 in reliability testing.