Implement capacity, sizing, and scaling
This page is the recompute procedure behind the architecture verdicts: the inputs to measure, the formulas that convert logical demand into a service unit, and one worked example. Use it when the SKU, the load, or the Azure limits change.
Step 1: Fix the demand scenario
Link to a dated version of the canonical capacity model and pick one complete scenario. Do not mix customer counts, incident ratios, amplification, or peak factors across scenarios. Anchor the result at today’s observed load, the checked-in SKU’s first ceiling, and the planned envelope.
Step 2: Record the amplification inputs
Capture average, P95, and maximum for each. Unknowns stay named measurements — do not substitute unlabelled assumptions.
| Boundary | Measure |
|---|---|
| Event store (Cosmos) | Appends/s, event bytes, RU/append, streams loaded/s, RU/full-stream load, stream length, partition skew |
| Change Feed | Items/s, physical partitions, processors, projection and publisher fan-out, lag, catch-up rate |
| Service Bus | Publications/s, matching subscriptions, bytes, sessions, deliveries, settlements, retries, dead letters |
| Temporal | Starts/s, activities/s, duration, open workflows, retries, timers, history bytes, DB ops/activity |
| SQL | Rows/event, writes/s, queries/request, cache miss ratio, row and index bytes, tenant skew, rebuild work |
| HTTP/APIM | Requests/s, policy cost, calls/request, response bytes, dependency latency, concurrency |
| SignalR | Connections, groups, sends/event, recipients/send, message bytes, reconnect and catch-up rate |
| Telemetry | Items/request or event, bytes/item, sampling, failure amplification, retention, GB/day |
Step 3: Discover the effective configuration
Read the IaC and record the value actually consumed by the module, not every
variable in a .tfvars file, then note any drift from live Azure. Capture SKU,
units, partitions, replicas, zones, storage, autoscale min/default/max, scale
metrics and cooldowns, Function hosting plan and max instances, processor
leases/worker concurrency/prefetch, connection pools, DB limits, retention, daily
caps, and provider quotas.
Two resources stay unresolved here and must surface as Blocked, not sized: the Temporal Container Apps + MySQL stack against documentation that names PostgreSQL, and the Managed vs legacy Redis deployment.
Step 4: Convert demand to a service unit
Cosmos RU/s = writes/s × RU/write
+ stream loads/s × RU/full-stream load
+ catch-up items/s × RU/item
Service Bus ops/s ≈ P × (1 + 2S) + retry and dead-letter ops/s
SQL writes/s = matching events/s × rows/event
SQL queries/s = requests/s × queries/request × cache miss ratio
Temporal activities/s= incidents/s × workflows/incident × activities/workflow
Temporal IOPS = activities/s × measured DB ops/activity
SignalR messages/s = events/s × recipients/event × 2 KB chunks/message
Telemetry GB/day = items/day × bytes/item / 1e9
P is publication rate, S the mean matching subscriptions. Batching changes
broker-op count but not the need to measure bytes and end-to-end latency. Include
full-stream reconstruction in the Cosmos read term — snapshots are not deployed.
Worked event-pipeline example
Converts the reference 401 events/s sustained peak into a test. Illustrative: RU, fan-out, and payload must be replaced with measured values.
Assume: 401 events/s, five matching subscriptions, 8 KB P95 payload, 10 RU/append, one SQL row per matching delivery, 1% transient redelivery.
| Boundary | Calculation | Test input |
|---|---|---|
| Cosmos append | 401 × 10 RU | 4,010 RU/s before reads and Change Feed |
| Service Bus base ops | 401 × (1 + 2 × 5) | 4,411 ops/s |
| Service Bus payload | 401 × 8 KB | ~3.2 MB/s |
| Subscription deliveries | 401 × 5 | 2,005 deliveries/s |
| Transient redelivery | 2,005 × 1% | ~20 deliveries/s plus settlements |
| Projection writes | 401 × matching projectors | Measure per projection, not one shared SQL rate |
Re-run at the 1,157 events/s stress rate. Arithmetic alone does not prove fit — the test must use real partition keys, sessions and filters, consumers, indexes, downstream latency, and backlog recovery.
Step 5: Record the verdict
| Field | Evidence |
|---|---|
| Boundary | One independently scalable resource or dependency |
| Calculated demand | Average, sustained peak, burst, and recovery in the resource’s unit |
| Effective configuration | Checked-in and live SKU, scale, partition, and concurrency settings |
| Tested capacity | Highest representative load meeting latency, freshness, recovery, and error targets |
| Published ceiling | The binding hard limit, or a note that throughput is benchmark-dependent |
| First constraint | Earliest service, partition, connection, I/O, latency, storage, or quota boundary |
| Trigger | Observable threshold with an owner, window, and response time |
| Verdict | ✅ Fits, ⚠️ At risk, ❌ Insufficient, 🚫 Blocked, or ❓ Unknown |
| Action | Tune, scale, isolate, repartition, migrate, or redesign |
Only ✅ Fits permits an unconditional capacity claim. Replay, backfill, and rebuild run on an isolated, rate-capped lane that must not consume live-path headroom or republish reconstructed events as new facts.