Compute Design and Auto Scaling

Learn to design the compute layer of a cloud workload so it stays fast and available as demand changes. Choose and size instance types on AWS, Azure and Google Cloud, spread instances across fault domains and availability zones, and build auto scaling groups and scale sets with policies that follow real load. Run containers and serverless functions for performance, decouple components with queues, host web apps on managed platforms and release them through deployment slots, then prove the design with load tests.

IntermediateLesson 3 of 8 in Cloud Architecture and Administration Course

What you will learn

  1. Read instance type names on AWS, Azure and Google Cloud, match instance families to what a workload actually uses, and size an instance from measured demand with planned headroom.
    • Read instance families and size names
      Decode instance type names on the three major clouds and match each family to the resource a workload uses most.
    • Size an instance from measured demand
      Find the resource that limits a workload, choose a size with headroom, decide between scaling up and scaling out, and use burstable types only where their credit model fits.
  2. Spread virtual machines across fault domains, availability sets, placement groups and availability zones, and plan capacity so a workload keeps serving when a rack or a whole zone fails.
    • Spread VMs with availability sets and placement groups
      Use fault domains, update domains, Azure availability sets and AWS and Azure placement groups to control how instances share hardware inside one data center.
    • Deploy across availability zones and plan for zone loss
      Distribute instances across availability zones, read zone names correctly and size capacity so the workload still meets its peak when one zone fails.
  3. Build AWS Auto Scaling groups, Azure Virtual Machine Scale Sets and Google Cloud managed instance groups, choose scaling policies and metrics, and tune them so capacity follows demand quickly and safely.
    • Build a scaling group or scale set
      Define the template, capacity limits, zones, health checks, load balancer links and update method of a group of interchangeable instances.
    • Choose and configure a scaling policy
      Compare target tracking, step, simple, scheduled and predictive scaling, write Azure autoscale rules, and pick a metric that really tracks load.
    • Tune scaling speed and safe scale-in
      Shorten the time from rising load to ready capacity, prevent overshoot, and remove instances without dropping work.
  4. Run containers on managed services, design serverless functions that start fast and respect concurrency limits, and decouple components with queues and events so each part scales on its own.
    • Run containers on managed container services
      Store images in a registry, run them on Azure Container Instances, Azure Container Apps, Amazon ECS with Fargate or Google Cloud Run, and size and scale them for the load.
    • Design serverless functions for performance
      Configure function memory, timeouts and concurrency, reduce cold starts, and choose an Azure Functions hosting plan that fits the workload.
    • Decouple components so each part scales on its own
      Place queues, topics and event buses between components, process messages safely when they arrive more than once, and scale consumers on the backlog.
  5. Configure App Service plans and similar app hosting services for scale and performance, and release new versions without downtime through deployment slots, swaps and traffic splitting.
    • Configure App Service plans and other app hosting services
      Choose an App Service tier, scale a plan up or out, set the options that affect performance, and compare App Service with Elastic Beanstalk, App Engine and Cloud Run.
    • Release new versions with deployment slots
      Deploy to a staging slot, swap it into production with warm-up and the right slot settings, roll back, and route part of the traffic to a new version.
  6. Plan performance tests with clear targets and realistic load, run them with load testing tools, read the results to find bottlenecks, and confirm that scaling settings keep up.
    • Plan performance tests with clear targets
      Choose the right kind of test, define pass criteria with latency percentiles, model realistic load, and prepare an environment and tools that give trustworthy results.
    • Find bottlenecks and tune scaling from test results
      Read client and server metrics together, locate the resource that limits throughput, check that autoscaling keeps up, and change one thing at a time.

Auto Scaling study guide

6 chapters

1

Choose and size compute instances for a workload

A compute choice commits you to a bundle of CPU, memory, disk and network capacity. The family name helps you find candidates, but measurements decide which one fits. Read the naming patterns on AWS, Azure and Google Cloud, check processor compatibility, then work from peak demand to a size with headroom. You will also decide when a larger machine helps and when several interchangeable machines are the better design.

1.1 Read instance families and size names

An instance type bundles virtual CPUs (vCPUs), memory, network capacity and sometimes local disks or accelerators. Azure calls it a VM size; Google Cloud calls it a machine type. A size word describes a position within a family, not one universal amount of memory.

Match the resource balance
FamilyResource emphasisTypical workload
General purposeBalanced CPU and memory, often about 4 GiB per vCPUWeb services with balanced demand
Compute optimizedMore CPU per unit of memory, often about 2 GiB per vCPUCPU-heavy processing
Memory optimizedOften 8 GiB or more per vCPULarge caches and in-memory data
Storage optimizedFast local disk input/outputHeavy local data processing
AcceleratedGPUs or other acceleratorsGraphics, video and machine learning

These ratios guide a search; the exact type specification decides what you receive. A vCPU also is not a universal physical core. On many x86 types it is one hardware thread; on AWS Graviton it is a full physical core.

Decode the provider names

In AWS c7gn.xlarge, c means compute optimized, 7 is the generation, g means Graviton Arm, n means network optimized, and xlarge is the size. Common series include m for general purpose, t for burstable, r for memory, x and u for high memory, i and d for storage, p for GPU and g for graphics. Options include a for AMD, i for Intel, d for local disks, e for extra resources and z for high CPU frequency. Position matters: the initial g in g5.xlarge means graphics; the later g in m7g.xlarge means Graviton.

Within the M7g family, large, xlarge and 2xlarge give 2/8, 4/16 and 8/32 vCPUs/GiB. Other steps differ: 8xlarge to 12xlarge grows from 32/128 to 48/192, a 50% increase. At xlarge, C7g, M7g and R7g each have 4 vCPUs but 8, 16 and 32 GiB respectively.

Azure Standard_D4ds_v5 means D family, 4 vCPUs, local temporary disk (d), Premium SSD support (s) and version 5. Families B, D, F, E, M, L and N cover burstable, general, compute, memory, very large memory, storage and GPU uses. N includes NC for compute and NV for visualization. Feature letters include a for AMD, p for Arm, l for lower memory and m for more memory. Compare F4s_v2, D4s_v5 and E4s_v5: each has 4 vCPUs, with 8, 16 and 32 GiB.

Google Cloud n2-standard-8 identifies series N2, type standard and 8 vCPUs. E2/N2 standard, highmem and highcpu provide 4, 8 and 1 GB per vCPU, so n2-highmem-8 has 64 GB. E2, N2, N4 and C4 are general purpose; C2 and H3 are compute optimized; M is memory optimized; A is accelerator optimized. Some series support custom CPU/memory combinations.

Check what can actually run

Arm choices include Graviton, Azure p sizes and Google C4A. Check every binary, container image and agent for arm64 support: an x86-only dependency blocks the move. Compare current generations for better performance per vCPU, and confirm the exact type exists in the deployment region and zones before choosing it.

Key Takeaways

  • Read the family and size together; a size word alone does not determine memory.
  • Check every dependency before moving a workload to Arm.
  • Read AWS option letters by position and Azure numbers as vCPU counts.
  • Confirm the exact type, generation and zone availability.

1.2 Size an instance from measured demand

Right-sizing selects the smallest type that meets the performance target with planned headroom. Collect CPU, memory, disk and network measurements over a representative period, including busy days. A two-week average can hide a daily peak that makes a smaller instance fail.

Find what runs out first

The binding constraint is the resource that limits useful work. An API at 85% CPU and 30% memory is a compute-family candidate. A cache at 20% CPU and 90% memory needs memory capacity. Low CPU with slow transfers can point to disk or network limits. Check the exact type’s baseline and maximum throughput: several smaller sizes may advertise the same “up to” burst limit.

Right-sizing recommendations from AWS Compute Optimizer or Azure Advisor help identify candidates. Guest memory measurements need an agent, such as the CloudWatch agent on EC2; the hypervisor does not see application memory use. Include expected growth that the recommendation cannot know.

Add headroom to each resource

Suppose an application peaks at 1.5 vCPUs of work and 6 GiB. Adding 25% to those measured peaks gives:

1.5×1.25=1.875 6×1.25=7.5

A 2-vCPU, 8-GiB general purpose type fits, such as m7g.large or Standard_D2s_v5. If memory instead peaks at 12 GiB, the memory requirement becomes 15 GiB. A 2-vCPU, 16-GiB memory type, such as r7g.large or Standard_E2s_v5, supplies that memory without buying unneeded CPU.

Choose a growth method
MethodWhat changesDesign consequence
Scale upMove to a larger instanceUseful for one-node software; size ceiling and restart risk remain
Scale outAdd instances that share workNeeds shared work distribution and state handling; can survive one instance failing

Web copies usually sit behind a load balancer, workers share a queue, and stateful systems need replication or partitioning. Several medium instances can provide both growth and redundancy. On AWS, stop an EBS-backed instance before changing its type. Azure restarts a resized VM and may require deallocation if the size is unavailable on its hardware cluster. A rolling replacement through a group can keep other instances serving during the change.

Decide whether CPU credits fit

Burstable AWS T and Azure B types earn credits below a CPU baseline and spend them above it. On AWS, one credit funds one vCPU at 100% for one minute. A t3.medium has 2 vCPUs and a 20% baseline, earning 24 credits per hour. At 60% CPU it spends 72, so the net draw is 48 credits per hour. A balance of 576 lasts 12 hours at that load.

In standard mode, an empty balance restricts CPU to baseline. Unlimited mode, the default for T3 and later T families, allows extra usage with possible surplus charges. Mostly idle services with short bursts fit this model; sustained above-baseline work belongs on fixed-performance capacity. Before buying larger hardware, check for a slow query, lock contention or a memory leak that added CPU will not repair.

Key Takeaways

  • Size from representative peaks and check CPU, memory, disk and network separately.
  • Add planned headroom before choosing the smallest type that fits.
  • Scale-out needs a way to share work and keep durable state off replaceable instances.
  • Plan the restart or rolling replacement needed for a resize.
  • Sustained CPU demand can exhaust credits or create surplus charges on burstable types.
2

Place instances to survive hardware and data center failures

Availability depends on which failures can remove your running copies together. Rack placement, maintenance groups and availability zones address different failure sizes. Learn how each provider spreads instances, then calculate how much serving capacity remains when one domain disappears. The same design must account for the load balancer and dependent services, because a surviving web instance still needs a working path to its data.

2.1 Spread VMs with availability sets and placement groups

A fault domain groups hardware that shares a power source and network switch. An update domain groups VMs that can restart together during planned maintenance. Spreading service copies across both reduces the number lost to either event.

Use an Azure availability set

An availability set spreads related VMs across up to 3 fault domains and up to 20 update domains, with 5 update domains by default. Choose both counts when creating the set; they stay fixed. The set has no separate charge, though its VMs do. Use at least two VMs doing the same job.

Consider 7 web VMs across 3 fault domains and 5 update domains. Update domains fill in turn: VMs 1 and 6 share domain 0, VMs 2 and 7 share domain 1, and the other domains contain one VM each. Maintenance affects one update domain at a time, so at most 2 VMs restart together. A balanced fault-domain spread is 3, 2 and 2, so a fault can remove 3 VMs. The remaining 4 must support the required load.

A VM joins an availability set at creation. Moving an existing VM requires retaining its disks, deleting the VM and recreating it in the set. A VM cannot simultaneously belong to an availability set and be pinned to an availability zone.

For two or more VMs in one availability set, Azure’s VM SLA specifies 99.95% connectivity. A single VM with all disks on Premium SSD or Ultra Disk has a 99.9% figure; putting that lone VM in a set does not give it the multi-instance figure. An SLA is a service commitment, while your actual service also depends on routing, software and capacity.

Choose proximity or separation
Placement choiceArrangementUseful when
AWS cluster groupInstances close together in one zoneTightly coupled processing needs low latency and high throughput
AWS spread groupEach instance on a separate rack; at most 7 running instances per zone per groupA few critical servers need separate hardware
AWS partition groupUp to 7 partitions per zone that do not share racksReplicated data systems can distribute replicas by partition
Azure proximity placement groupVMs physically closeCommunication delay between VMs is the main concern

For an AWS cluster group, launch the instances together using one instance type to reduce capacity-placement failures. Partition-aware systems such as Cassandra or HDFS can use partition information to avoid putting dependent replicas on shared racks.

Packing machines close improves communication but concentrates failure exposure. An availability set handles hardware and maintenance failures within a data center; it cannot carry the service through losing that entire data center. For new Azure designs, Flexible scale sets provide fault-domain or zone spreading plus autoscaling. Availability sets still serve existing workloads and regions without zones.

Placement also cannot separate copies from a common software error. A bad release, expired certificate or full disk can stop every copy. Release controls and health checks address failures that hardware separation leaves untouched.

Key Takeaways

  • Fault domains concern shared hardware; update domains concern planned restarts.
  • Size surviving capacity for the largest domain that can be lost.
  • Availability sets protect within a data center; zones address a wider failure.
  • Cluster and proximity groups favor communication speed; spread and partition groups favor separation.
  • Create Azure VMs in their intended availability set.
  • Hardware spreading leaves common software failures to other controls.

2.2 Deploy across availability zones and plan for zone loss

An availability zone contains one or more physically separate data centers with independent power, cooling and networking. Zones in a region communicate over low-latency links. AWS regions have at least three zones; zone-enabled Azure regions have at least three, while some Azure regions have none. Most Google Cloud regions have three or more.

Spread every required part

A zonal resource occupies one selected zone. A zone-redundant resource is distributed across zones by the platform. A resilient web tier needs instances in at least two zones and a zone-redundant load balancer. A database or cache confined to one zone can still stop the whole service.

Azure’s connectivity SLA for two or more VMs across two or more zones in one region is 99.99%. In a 30-day month, the downtime allowances corresponding to 99.9%, 99.95% and 99.99% are 43.2, 21.6 and 4.32 minutes. These figures describe the SLA calculation; enough surviving application capacity still has to be designed.

Zone labels need care across accounts. AWS us-east-1a can identify different physical zones in different accounts; an AZ ID such as use1-az1 identifies the same physical zone. Azure logical zones 1, 2 and 3 are mapped per subscription too.

Calculate capacity after a loss

Peak demand is 12,000 requests per second. One instance serves 800 at its target CPU. Required healthy capacity is:

12000÷800=15

With 5 instances in each of 3 zones, losing a zone leaves only 10 instances, serving 8,000 requests per second. To sustain peak immediately, distribute enough capacity that any two zones retain at least 15 instances. Equal placement needs:

15÷2=7.5

Round up to 8 per zone: 24 total. The two surviving zones supply 16 instances. This is static stability: serving the failure case requires no new launches. The 24-instance design has 60% more instances than the 15-instance healthy-load minimum.

Separate placement from recovery

An AWS Auto Scaling group balances across the zones of its selected subnets. Select subnets in at least two zones; it replaces lost capacity in healthy zones and rebalances after recovery. Azure scale sets distribute across their listed zones, with best-effort or strict balancing. A regional Google Cloud managed instance group distributes across regional zones.

Azure zone spreading alone does not guarantee new instances will launch in healthy zones during an outage. Detect the event with Resource Health or Service Health alerts, configure a response using autoscale rules and a recovery runbook, and test it. Strict balancing can block an action that would create an imbalance.

Running only the normal-load minimum and launching replacements after a failure uses less idle capacity, but accepts a period of reduced service. It also relies on launch speed, quotas and spare capacity being available during the outage. Listing three zones with a minimum of two instances leaves at least one zone empty. Account for cross-zone latency and transfer charges when arranging chatty components, while keeping the user-serving tier spread across zones.

Key Takeaways

  • A zone-resilient service needs a working load balancer and dependencies as well as spread instances.
  • Calculate what survives a zone loss before relying on the normal-load instance count.
  • Static stability carries peak load through failure without new launches.
  • Zone distribution and zone-outage recovery are separate capabilities.
  • Use physical zone identifiers for cross-account placement decisions.
3

Scale out automatically with scaling groups and scale sets

An autoscaling design needs more than a CPU threshold. New instances must reproduce the application, pass health checks and become ready before demand outruns the running group. Capacity limits, policy choice and startup delays all shape the result. Build the group first, choose a signal that reflects work per instance, then tune launch and removal so the group can grow without overshooting or interrupting work already in progress.

3.1 Build a scaling group or scale set

A scaling group maintains interchangeable instances: an AWS EC2 Auto Scaling group, Azure Virtual Machine Scale Set, or Google Cloud managed instance group (MIG). Its template, limits, placement, health checks and traffic registration must work together.

Make replacement repeatable

An AWS launch template defines the image, type, security groups, user-data startup script and IAM instance profile. Azure uses the scale set VM model; Google Cloud uses an instance template. Build application setup into the image and startup process. A manual fix on one VM disappears when that VM is replaced. Store session data and uploads externally so scale-in cannot delete them.

AWS minimum and maximum bound the desired count. With minimum 2, maximum 10 and desired 4, a request for 12 stops at 10; a request to shrink to 1 stops at 2. Azure autoscale’s default count has a different job: if metrics cannot be read and current capacity is below the default, autoscale raises it to that fallback. It is not the ordinary target count.

Check the application and traffic path

AWS starts with EC2 status checks. Enable Elastic Load Balancing health checks to detect an application that fails while its VM still runs. The health check grace period allows startup before failed health checks count: the console default is 300 seconds, while CLI/SDK creation defaults to 0. Set it from observed startup behavior.

Azure automatic repairs use the Application Health extension or a load balancer probe. A MIG uses a health check for autohealing. Register new web instances with the load balancer, and use connection draining on removal. On AWS, the deregistration delay gives active requests time to finish.

Choose how instances are managed
Azure modeInstance modelMain distinction
FlexibleStandard Azure VMsRecommended; supports mixed sizes and Spot/regular VMs, with fault-domain or zone spreading, up to 1,000 VMs
UniformScale set instances managed through scale set APIsUses an identical-instance model

Choose orchestration mode at creation; it cannot be changed later. Do not confuse this management choice with a zone-recovery guarantee.

A template change does not automatically replace every running instance. AWS instance refresh replaces batches while maintaining a minimum healthy percentage. With 20 instances and a 90% minimum healthy setting, 18 stay healthy and 2 can be replaced at a time when no extra surge capacity is used. Azure upgrade policies are Automatic, Rolling or Manual; Manual leaves existing instances unchanged until explicitly upgraded. MIG rolling updates set maximum surge and maximum unavailable.

Add interruptible capacity deliberately

Spot capacity can support stateless work above a regular-capacity base. AWS provides a two-minute interruption notice; Azure’s Scheduled Events warning is best effort, up to 30 seconds before eviction, so work must also survive no warning. Allow several suitable instance types so a shortage of one type does not halt growth. Keep minimum below maximum, and place the group across zones: a perfectly configured scaling policy cannot overcome a fixed count or a single-zone design.

Key Takeaways

  • Put reproducible configuration in the template and durable state outside instances.
  • AWS desired count and Azure default count serve different purposes.
  • Application health checks detect failures that VM status checks can miss.
  • Choose Azure orchestration mode at creation and plan how template changes reach existing VMs.
  • Combine interruptible capacity with a regular base and recoverable work.

3.2 Choose and configure a scaling policy

A useful scaling policy responds to the amount of work each instance must do. Choose the signal before the threshold. CPU suits CPU-bound processing; requests per target suits web requests of similar cost; backlog per instance suits workers. Slow responses alone can come from a database, so latency is a poor main proportional scaling metric.

Match the policy to the demand
PolicyActionGood fit
Target trackingAdjusts capacity to hold a metric near a targetWork per instance that falls as capacity grows
Step scalingAdds larger adjustments for larger alarm breachesExplicit response sizes for different load levels
Simple scalingMakes one adjustment, then waits for cooldownOlder fixed-adjustment configurations
ScheduledChanges capacity limits or counts at known timesKnown events and regular opening hours
PredictiveLaunches ahead of forecast demandCyclical demand and slow startup

Manual scaling sets the count directly. Dynamic policies follow measured load; they often operate alongside a schedule or forecast.

With 6 instances at 90% CPU and a 60% target, proportional demand suggests:

6×90÷60=9

The target-tracking service manages alarms and capacity changes. The metric must approximately halve when capacity doubles for unchanged total work. A step policy with an alarm at 60% might add 1 at 60–70%, 2 at 70–85%, and 4 above 85%; a 78% reading adds 2. AWS recommends target tracking or step scaling over simple scaling, whose default cooldown is 300 seconds.

Use schedules and forecasts

An Azure fixed-date profile applies to a specific event; a recurrence profile applies on selected weekdays; the default profile covers other times. Fixed-date takes priority over recurrence, then default. Raising the minimum before a known busy period gives instances time to start.

AWS predictive scaling needs at least 24 hours of history, analyzes up to 14 days and forecasts 48 hours ahead in hourly intervals. Check forecast-only mode before allowing launches. Predictive scaling does not scale in, so pair it with a dynamic policy. Azure also offers CPU-history-based predictive autoscale for scale sets.

Write rules that can grow and shrink

An Azure rule specifies the metric, time grain statistic, duration, time aggregation, comparison, threshold, action and cooldown. For example, average Percentage CPU above 70 over 10 minutes adds 1 instance, followed by 5 minutes of cooldown. A companion rule below 30 over 10 minutes can remove 1.

With multiple rules, Azure scales out when any outward rule fires and chooses the largest resulting count. It scales in only when all inward rules fire, removing the fewest instances requested. AWS also selects the policy that leaves the largest capacity when policies compete.

Avoid immediate reversals

Flapping occurs when a scale action creates the condition for its opposite. Two instances at 45% CPU become one at roughly 90% after a removal, assuming unchanged work. An out-above-70/in-below-50 pair would reverse that removal. Azure estimates the effect and may skip or reduce scale-in. Wider separation, such as 70% out and 30% in, makes the rules more stable.

Key Takeaways

  • Choose a metric that reflects the workload’s limiting resource.
  • Target tracking needs a metric that falls as serving capacity increases.
  • Use schedules or forecasts when instances must be ready before a predictable peak.
  • Pair growth policies with a way to scale in.
  • Separate scale-out and scale-in thresholds to avoid reversals.
  • Check how competing rules choose the resulting capacity.

3.3 Tune scaling speed and safe scale-in

A scaling action helps only when the new instance can serve real work. The delay includes metric collection and evaluation, launch, boot, application startup and warm-up. If those stages take 6 minutes while traffic doubles in 2, a reactive policy cannot cover the first wave by itself.

Reduce the readiness gap

Keep headroom with a lower utilization target or a higher minimum. Use scheduled or predictive capacity before known peaks. Prebuilt images reduce setup at launch. AWS warm pools keep pre-initialized instances stopped, running or hibernated; stopped instances still incur storage charges. Azure standby pools serve a similar purpose.

A cooldown waits after a scaling action. AWS’s default 300-second cooldown applies to simple scaling; Azure sets cooldown per autoscale rule. Too short a wait can cause repeated additions before their benefit appears. Too long a wait can delay a needed response to a second wave.

Default instance warmup on AWS controls when a new in-service instance’s metrics enter the group aggregate. Its capacity already counts while it warms, preventing repeated launches for the same shortfall, and scale-in waits for warmup. It is not enabled by default. AWS suggests 300 seconds as a starting point, then tuning to the application. This differs from a health check grace period, which delays acting on startup health-check failures.

Scale workers from waiting work

Backlog per instance divides waiting messages by running workers. For a worker processing one message at a time, divide acceptable queue delay by average processing time to get a target:

30÷0.5=60

A 30-second delay budget and 0.5-second processing time allow roughly 60 waiting messages per worker. With 1,500 messages waiting:

1500÷60=25

Group limits and readiness time still constrain that estimate. Raw queue length alone cannot distinguish a backlog supported by many workers from the same backlog supported by few.

Remove instances without abandoning work

A web server stops receiving new traffic and drains active requests. A worker stops fetching messages, then finishes or releases what it holds. AWS lifecycle hooks can pause launch or termination for setup, log copying or draining; Azure offers terminate notifications. Long jobs need checkpoints or scale-in protection so removal does not lose progress.

AWS’s default termination policy first preserves zone balance, then favors old launch templates or configurations. Azure’s default balances zones and fault domains, then removes the highest instance ID; NewestVM and OldestVM are alternatives. AWS scale-in protection and Azure instance protection can preserve selected busy instances.

Check limits beyond the policy

A group maximum, regional vCPU quota or shortage of a particular type can stop growth. Raise quotas before an event, allow suitable alternative types and alert when the group remains at maximum. Test a load increase followed by a decrease: measure readiness time, then confirm draining, safe job completion and stable scale-in.

Key Takeaways

  • Measure the full delay from increased load to useful capacity.
  • Cooldown, instance warmup and health check grace period control different parts of scaling.
  • For serial workers, target backlog per instance from delay budget divided by processing time.
  • Drain requests and finish, release or checkpoint worker jobs before termination.
  • Check group limits, quotas and type capacity before planned peaks.
4

Design container and serverless workloads for performance

Managed containers and functions can grow quickly, but they still need resource limits, startup choices and a safe relationship with downstream services. Choose how the platform runs your code, then tune CPU, memory and concurrency from measurements. Queues and events let each part grow independently, while message handling must survive retries and duplicate delivery. Work through the tradeoffs between a fast response, waiting work and protected data services.

4.1 Run containers on managed container services

Managed container services take over different amounts of infrastructure work. Begin with a reproducible image: the application, libraries and runtime packaged together. Store it in Amazon ECR, Azure Container Registry (ACR) or Google Artifact Registry. Pin a never-reused version tag or a digest such as sha256:…; latest can make a scale-out mix code versions.

Choose a container service
ServiceRunning unitScaling responsibility
Azure Container InstancesContainer group sharing host, network and lifecycleNo built-in autoscale; run more groups
Azure Container AppsRevision with replicasManaged ingress and KEDA event-driven scaling
Amazon ECS serviceTasks from a task definitionService scaling changes task count; EC2 capacity must also scale if used
Google Cloud RunContainer instances serving requestsManaged scaling based partly on request concurrency

ACI bills by the second and supports Always, OnFailure and Never restart policies. Changing CPU, memory, OS type, restart policy or zone requires deleting and recreating the group. ACI and individual Fargate tasks suit simple jobs; Container Apps, Cloud Run and ECS services suit web services and workers. Teams needing the full Kubernetes API can choose managed Kubernetes with its added operational work.

Control registry access and resources

ACR Basic, Standard and Premium offer different capabilities; Premium adds geo-replication and private endpoints. ACR Tasks can build images with az acr build. Use managed identity for pulls: grant AcrPull on standard-permission registries, or Container Registry Repository Reader on ABAC-enabled registries.

An ECS task definition records image, CPU, memory, ports and IAM role. Fargate provides capacity per task; EC2-backed ECS needs an Auto Scaling group capacity provider too. Otherwise extra tasks can remain PENDING. Fargate requires valid CPU/memory pairs: 0.25 vCPU with 0.5–2 GB, 1 vCPU with 2–8 GB, or 16 vCPUs with 32–120 GB. If a task serves 250 requests per second, 3,000 requires 12 tasks; set maximum above that for headroom. Fargate Spot tasks are interruptible with a two-minute notice.

Tune replica counts and concurrency

Container Apps revisions default to minimum 0 and maximum 10 replicas. Rules can follow HTTP concurrency, TCP connections or custom signals such as queue length. The HTTP default is 10 concurrent requests per replica. A queue rule with target 20 messages per replica and 120 messages requests 6 replicas. Round fractional requirements up, then apply the limits.

Minimum 0 permits scale-to-zero with a suitable trigger. CPU and memory rules cannot wake an app from zero because there is no running replica to report those metrics. On Consumption, zero replicas have no replica usage charges; Dedicated workload profiles still bill allocated infrastructure. Minimum 1 or more reduces first-request startup delay.

Cloud Run’s new-service concurrency default is 80 in the console and 80 times vCPU count through gcloud or Terraform; the configurable maximum is 1,000. Higher concurrency packs requests into fewer instances but can increase contention. Minimum instances keep warm capacity; a maximum limits growth and downstream pressure. Split traffic across revisions for gradual releases.

Measure container CPU and memory. Too little CPU throttles processing; too little memory can cause termination and restart. Small images and brief startup routines reduce the delay before new replicas help.

Key Takeaways

  • Deploy an immutable image reference so replacement instances run a known version.
  • ACI group count, ECS task count and managed replica count are different scaling units.
  • Use the registry role that matches its permission mode.
  • Measure CPU, memory and concurrency before changing container size.
  • Scale-to-zero needs a trigger that can observe work while no replica runs.
  • Warm minimum capacity reduces startup delay but keeps resources allocated.

4.2 Design serverless functions for performance

A serverless function runs when an HTTP request, queue message, upload or schedule triggers code. AWS Lambda, Azure Functions and Google Cloud Run functions manage the execution infrastructure. Consumption-style hosting can scale to zero and charges by requests and memory-duration use; provisioned or always-ready capacity has an ongoing cost.

Balance memory, duration and concurrency

Standard Lambda functions support 128–10,240 MB memory, with CPU rising proportionally; 1,769 MB gives the equivalent of one vCPU. Their timeout is at most 900 seconds, or 15 minutes. Configurable /tmp storage ranges from 512 to 10,240 MB. This invocation limit applies to standard Lambda functions; the separate Managed Instances option has different limits.

More memory can make CPU-bound work faster. Compare 512 MB for 800 ms with 1,024 MB for 400 ms:

0.5×0.8=0.4 1×0.4=0.4

Both use 0.4 GB-seconds under the same memory conversion convention. At the same compute rate, the second completes twice as fast with the same memory-duration charge. Benchmark the actual function; doubled memory does not guarantee halved duration.

Concurrency is work running at once. At 400 requests per second and an average duration of 0.25 seconds:

400×0.25=100

The usual Lambda regional account concurrency quota is 1,000 and can be increased; new accounts can start with lower quotas. At 2,000 requests per second and 0.6 seconds, demand is 1,200 concurrent executions. If the available quota is 1,000, excess synchronous requests are throttled, typically with HTTP 429.

Separate a cap from warm capacity

Reserved concurrency both guarantees a function part of the account pool and caps it at that amount. It helps protect a database from too many simultaneous executions. Provisioned concurrency keeps environments initialized to reduce cold starts and is billed while configured.

A cold start loads code, starts the runtime and runs initialization before the handler. Keep packages small and create reusable SDK clients or connections outside the handler. Provisioned concurrency, SnapStart on supported Lambda runtimes and Azure always-ready instances reduce startup delay.

Choose Azure hosting and request behavior
Azure Functions planMain performance choice
Flex ConsumptionRecommended serverless plan; Linux, VNet integration, always-ready support; up to 1,000 instances; 512, 2,048 or 4,096 MB
PremiumPrewarmed capacity and longer executions
DedicatedRuns on an App Service plan with allocated capacity
Container AppsHosts functions on the container platform
Legacy ConsumptionDefault timeout 5 minutes, maximum 10

An HTTP-triggered Azure function must respond within 230 seconds because of the front-end load balancer, even if execution timeout is longer. Accept long jobs quickly and continue through a queue or Durable Functions.

Keep durable state in a database, cache or object store; local memory and disks can disappear between invocations. Step Functions or Durable Functions coordinate multi-step work. Reuse connections and consider a proxy such as RDS Proxy, a concurrency cap or a queue: fast function scaling can otherwise overwhelm a database. For steady high-volume or long-running work, compare containers or VMs using measured demand.

Key Takeaways

  • Benchmark memory and duration together; memory also changes Lambda CPU capacity.
  • Concurrency equals arrival rate multiplied by average execution duration.
  • Reserved concurrency caps and reserves; provisioned concurrency keeps environments warm.
  • Azure HTTP response limits remain separate from function execution timeouts.
  • Keep durable state external and limit downstream connection pressure.

4.3 Decouple components so each part scales on its own

A synchronous chain makes every caller wait for the next service. A slow processing stage can therefore hold open the user request and spread a failure upstream. Decoupling inserts messaging so producers can accept work while consumers process it at their own rate.

Match the delivery pattern
PatternDelivery behaviorExamples
QueueCompeting consumers share messages; one handles each deliverySQS, Service Bus queues, Azure Queue Storage
Publish/subscribeEach subscription gets its own copySNS, Service Bus topics, Google Cloud Pub/Sub
Event routingEvents go to targets matching routing rulesEventBridge, Event Grid

A queue fits work that can wait, such as producing a report. A password check normally needs an immediate answer, so adding a queue there changes the user interaction in an unhelpful way. Publish/subscribe fits separate services that each need to react to the same event, such as billing and notifications.

Separate a burst from a sustained shortfall

Suppose 5,000 orders are waiting after a burst, no new orders arrive, and workers complete 50 per second. The backlog clears in:

5000÷50=100

Customers can receive “order received” immediately while processing continues. This queue-based load leveling smooths a short peak. If arrivals continue at 20 per second, only 30 per second of worker capacity is left to reduce that initial backlog. If arrivals stay above total processing capacity, the queue keeps growing and consumers must scale or arrivals must be controlled.

Scale consumers with backlog per instance, a Container Apps KEDA queue rule, Lambda event source mapping or queue-triggered Functions. The message’s age is also useful when deciding whether users are waiting too long.

Make retries safe

Most messaging systems offer at-least-once delivery. The same message can arrive again; standard SQS also does not guarantee ordering. FIFO queues add ordering and duplicate-removal features, but application effects still need careful handling across failures.

An idempotent consumer makes repeated processing have the same effect as one successful processing. Record a stable order ID together with the completed effect, and skip a duplicate already committed. A separate “check then write” with no coordination can race when two deliveries run together.

During processing, SQS hides the message for a visibility timeout, 30 seconds by default; Service Bus uses a lock duration. If the message is not deleted before that period expires, it becomes available again. Set the period above processing time. For SQS feeding Lambda, AWS recommends at least six times the function timeout. Send messages that repeatedly fail to a dead-letter queue for inspection.

Return quickly for long work

With asynchronous request-reply, an API accepts a job and returns HTTP 202 Accepted plus a status URL. A client polls that URL or receives a callback when processing finishes. This handles work longer than an HTTP response can wait, including Azure’s 230-second front-end limit, while keeping the actual result distinct from the initial acceptance.

Key Takeaways

  • Use a queue for shared work and publish/subscribe when each subscription needs a copy.
  • A queue absorbs bursts; sustained arrivals still need enough processing capacity.
  • Make business effects idempotent because a message can be delivered again.
  • Allow enough visibility time and isolate repeated failures in a dead-letter queue.
  • HTTP 202 acknowledges acceptance; the final result arrives separately.
5

Host web apps on managed platforms and release them with deployment slots

A managed web platform handles much of the runtime, but the plan still determines which apps share compute and how they grow. Plan changes affect performance, while release settings decide whether a new version starts with the right configuration. Configure the hosting capacity first, then use staging, warm-up and gradual traffic changes to release code. A quick rollback also depends on keeping the database compatible with both versions.

5.1 Configure App Service plans and other app hosting services

Managed app hosting runs the operating system, runtime, patching and load balancing while you deploy code or a container. Azure App Service hosts web apps and APIs on Windows or Linux. Elastic Beanstalk builds visible EC2, Auto Scaling and load balancer resources from a code bundle. App Engine and Cloud Run offer Google Cloud alternatives.

Understand the shared plan

An App Service plan defines region, operating system, tier, size and instance count. In the normal shared-plan arrangement, each app runs across the plan’s instances and grows with the plan. Deployment slots, WebJobs and backups also consume those resources. Moving one resource-heavy app into its own plan separates its compute demand and scaling decisions.

TierScale and feature boundary
Free / SharedShared VMs with CPU-minute quotas; no scale-out
BasicDedicated instances; manual scale-out to 3; no autoscale or deployment slots
StandardUp to 10 instances, autoscale and a 5-slot allowance
Premium v3Up to 30 instances and a 20-slot allowance on faster hardware
Isolated v2App Service Environment in a virtual network for isolation and high scale
Scale size or count

Scale up changes tier or instance size, for example P1v3 to P2v3. It can supply more CPU/memory or unlock a feature. Scale out increases instance count. From Standard upward, Azure autoscale uses metric rules and schedule profiles. Premium automatic scaling is a separate HTTP-driven feature using prewarmed instances and a maximum per app.

An S1 plan with 2 instances hosts apps A, B and C. If CPU rules grow the plan to 8, all three apps normally run on 8 instances. If only A needs that many copies, use supported per-app scaling to limit B and C to 2, or move A to its own plan. Per-app limits do not give A separate underlying hardware from the other apps in that plan.

Keep serving instances ready

Always On keeps an app loaded through idle periods and is needed for continuous WebJobs. ARR affinity pins a client to one instance; stateless apps usually turn it off so load can spread. A health check path helps the platform remove failing instances from traffic and replace them. Supported zone-redundant plans distribute instances across zones.

Scale only after locating the bottleneck. Extra plan instances can share application load, but a slow query or memory leak still needs its own fix. Small apps sharing a plan also compete with a busy neighbor.

Configure the app’s public and private paths

Map a custom domain with a CNAME or A record and prove ownership using an asuid TXT record. Bind a TLS certificate using SNI: use an App Service managed certificate, an imported certificate or one held in Key Vault. Schedule backups of app content and configuration.

Access restrictions and private endpoints govern inbound access. Virtual network integration supplies an outbound path from the app to network resources. Keeping these directions distinct matters when a health check works publicly but the application cannot reach a private dependency.

Key Takeaways

  • Apps and slots in one plan share its compute resources.
  • Scale up changes size or tier; scale out changes the number of serving instances.
  • Basic supports manual scale-out but does not supply autoscale or slots.
  • Use readiness, affinity and zone settings to support the application’s traffic behavior.

5.2 Release new versions with deployment slots

A deployment slot is a live app with its own hostname on the production app’s plan. A staging slot can run the next version while production continues to serve. Production is itself a slot. Standard, Premium and Isolated support slots, with published allowances of 5, 20 and 20 respectively.

Prepare configuration before swapping

Some configuration travels with code; some stays attached to the slot.

BehaviorExamples
Normally swaps with codeApp settings and connection strings, framework versions, handler mappings and WebJobs content
Can be marked slot-specificApp settings and connection strings, such as a database connection
Stays with the slotCustom domains, private certificates/TLS settings, scale settings, IP restrictions, Always On, diagnostics, CORS, managed identities and VNet integration

Mark environment-specific connection strings as deployment slot settings so each slot retains its own final value. Otherwise an ordinary setting can travel with the application content.

Follow the swap sequence

Deploy version 2 to staging and test its own URL. During a swap, App Service first applies production’s slot-specific settings to the source instances and restarts them. After all restart, the platform warms each instance with an HTTP request. Only then does it switch routing. Production keeps serving during preparation, and its old version ends up in staging after completion.

A swap with preview pauses after production configuration has been applied to staging. Validate version 2 with that configuration, then complete or cancel. Because staging can reach production dependencies during this phase, use checks that avoid unintended business changes.

Warm-up should test real readiness. Configure applicationInitialization in web.config, or use WEBSITE_SWAP_WARMUP_PING_PATH, such as /health, and WEBSITE_SWAP_WARMUP_PING_STATUSES, such as 200,202. Requiring expected statuses prevents a failed readiness response from being accepted as a successful warm-up. Auto swap performs a warmed swap after deployment, but is unsupported for Linux web apps and Web App for Containers.

Limit exposure and preserve rollback

Traffic routing can send 10% of production traffic to staging before a full swap. The x-ms-routing-name cookie keeps a routed client on its assigned slot. A tester can request staging with ?x-ms-routing-name=staging.

If the completed swap raises errors, swapping the same slots again restores the old code. That does not reverse a database migration. Both versions must understand the database during release and rollback: add compatible columns first and remove obsolete ones after the old code is gone.

Slots share plan instances, so a staging load test can slow production. Use separate capacity for tests requiring isolation. A plan with more than 5 slots cannot move down to Standard without reducing the slot count.

Recognize equivalent release choices

Elastic Beanstalk offers all-at-once deployment with downtime, rolling batches with reduced capacity, rolling with an additional batch to preserve capacity, immutable deployment on new temporary-group instances, and traffic splitting for a canary. Blue/green deployment swaps environment URLs. Cloud Run, App Engine and Container Apps divide traffic among revisions or versions by weight.

Key Takeaways

  • A swap prepares and warms source instances before production routing changes.
  • Keep environment-specific settings attached to their slots.
  • Preview and traffic routing expose different stages of release validation.
  • A code rollback needs a database schema that both versions can use.
  • Staging and production slots share plan resources.
  • Match release policy to the required serving capacity and rollback method.
6

Test and tune performance under load

A performance test is useful when its workload, measurements and pass criteria answer a clear question. Expected peak, sudden bursts and long steady runs reveal different limits. Build a realistic test, then read client response times beside server resource use to find where requests begin waiting. Verify the whole scaling cycle, including readiness and scale-in, and compare controlled changes using the same workload.

6.1 Plan performance tests with clear targets

Performance testing measures latency, throughput, errors and resource use under a defined workload. Write the pass criteria first: “At 2,000 requests per second, p95 latency stays below 300 ms and errors below 0.5% for 30 minutes.” A run then has a clear success condition.

Choose the load shape
TestLoad patternWhat it reveals
LoadSustained expected peakWhether the service meets its target
StressIncreasing beyond expected peakBreaking point and failure behavior
SpikeSudden jumpWhether capacity becomes ready fast enough
SoakNormal load for hoursSlow memory or resource growth
ScalabilityStepped load with growing capacityWhether throughput grows with resources
Read the tail of response times

A percentile reports a position in sorted measurements. With nearest-rank p95, at least 95% of values are at or below that position. Consider these 20 times in milliseconds:

95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 108, 110, 112, 115, 120, 125, 130, 610, 940.

The mean is 173.5 ms and the median is 104.5 ms. Nearest-rank p90 is the 18th value, 130 ms; p95 is the 19th, 610 ms. The median describes a typical request but hides the two very slow ones. Use percentiles and error rates together: fast rejected requests should not make a failing test look healthy.

Model users and requests separately

Mix operations in realistic proportions, such as 70% browsing, 25% search and 5% checkout. Use varied data, realistic cache conditions and time between user actions. A test repeatedly reading one cached record measures a different workload from users searching a large data set.

Little’s law relates average requests in progress, throughput and time in the system:

L=λW

Here, L is average concurrent work, λ is completed requests per second, and W is average response time in seconds. At 200 requests per second and 0.25 seconds each, 50 requests are in progress. With 4.75 seconds of think time per user, a full user cycle is 5 seconds, so 1,000 virtual users produce about 200 requests per second. Virtual users include time spent thinking; concurrent requests do not.

Make the environment credible

Match production instance types, scaling settings, data volume and network path. Generate traffic from locations representing users. Watch the generators’ CPU and network so they can actually supply the intended load. Obtain permission before testing a service owned by someone else.

JMeter, Locust, k6 and Gatling generate load. Azure Load Testing runs quick URL tests or JMeter/Locust scripts, correlates server metrics, applies fail criteria and can run in CI/CD. Distributed Load Testing on AWS is another managed approach. Keep tests running long enough to include scaling reactions and record both warm-cache and colder-cache behavior when users experience both.

Key Takeaways

  • Choose the test shape from the question you need answered.
  • Set throughput, latency, error and duration thresholds before running the test.
  • Tail percentiles reveal slow requests that averages can hide.
  • Distinguish virtual users from simultaneous requests when think time is present.
  • Validate the test environment and the load generators.

6.2 Find bottlenecks and tune scaling from test results

Start at low load to establish a baseline, then increase in controlled steps. Align client latency, throughput and errors with server CPU, memory, queue length, database connections and throttling on the same time axis. The timing helps identify which saturated resource preceded the slow responses.

Find where throughput stops keeping up
Offered requests/sDelivered requests/sp95 latency
500500120 ms
1,0001,000140 ms
1,5001,400450 ms
2,0001,4202,300 ms

The knee occurs as delivered throughput levels near 1,400 requests per second and latency starts rising sharply. Extra arrivals are waiting or failing. Check which resource reached its limit at that point; the curve locates the capacity region but does not identify the resource by itself.

High app CPU can justify more instances or a compute optimized family. Low CPU with high latency suggests waiting on a database, external API, connection pool or lock. HTTP 429 points toward a quota, concurrency limit or throttling rule. Errors concentrated on newly launched instances suggest readiness or health-check timing.

Memory growing during a soak test needs investigation. Retained objects can indicate a leak, but expanding caches or pending work can also explain growth. Observe whether the level stabilizes and inspect what is retained before deciding on a fix.

Measure scaling against the latency budget

Suppose traffic jumps from 300 to 3,000 requests per second. Each instance serves 250, and only 2 are running. Required capacity is:

3000÷250=12

Until new capacity is ready, existing instances serve only 500 requests per second. If startup takes 4 minutes, the missing capacity persists through that interval. Raising the maximum alone will not solve that timing gap. A higher minimum, capacity scheduled ahead or shorter startup can protect the response target.

Measure when load rose, when the policy reacted, when instances launched and when they first served successfully. Check the group maximum, vCPU quotas and type availability. A cap can explain a plateau even when the application would scale further.

Test the return to normal

After demand falls, observe scale-in. Requests in progress should finish, workers should complete or release messages, and counts should settle without repeated reversals. Include the full decrease in the test; ending at peak misses termination problems.

Change one thing and repeat the same workload. Candidate changes include a better-matched instance family, pooled connections, caching, queued background work, more function memory or a different container concurrency target. Compare p95, errors and resource use together so one apparent improvement does not conceal another regression.

Keep test results to detect gradual drift. A short CI/CD load test with fail criteria can block a release that worsens latency or error rate before it reaches production. It complements longer spike and soak tests that expose behavior a short release check cannot exercise.

Key Takeaways

  • Locate the capacity knee, then use server metrics to identify the limiting resource.
  • Low app CPU with high latency calls for dependency and waiting-time investigation.
  • Measure time to useful capacity, including the startup gap.
  • Verify safe, stable scale-in after demand falls.
  • Change one variable per comparison and keep the workload consistent.
  • Store results and enforce useful performance thresholds in delivery checks.

Auto Scaling examples

6 Walkthroughs

1

Choose a machine from workload evidence

12 steps
Decode machine types, calculate headroom and decide how a workload should grow.
  1. 1
    IntroductionStart with the workload’s limiting resource

    A machine type is a bundle of CPU, memory, network and sometimes disks or accelerators. The name helps you find candidates, but the application’s measurements determine the fit.

    Follow a reporting service from resource observations to a type choice. First identify the family, then calculate headroom and check whether its growth should come from a bigger machine or more copies.

  2. 2
    ExplanationCompare resource balances

    General purpose types balance CPU and memory. Compute optimized types offer more CPU relative to memory; memory optimized types offer more memory per vCPU.

    A large cache can run short of memory while CPU stays mostly idle. A memory family adds the resource it needs without forcing the same CPU increase as a larger balanced type. Storage and accelerated families serve other measured bottlenecks.

  3. 3
    ExampleRead an AWS name by position

    In c7gn.xlarge, read the name in parts:

    • c: compute optimized series.
    • 7: generation.
    • g: Graviton Arm processor.
    • n: network optimized option.
    • xlarge: size within the family.

    Position changes meaning: the first letter in g5.xlarge identifies the graphics series. A later g in m7g.xlarge identifies the processor.

  4. 4
    ConnectionRead Azure and Google names

    Azure Standard_D4ds_v5 identifies a D-family VM with 4 vCPUs, a local temporary disk, Premium SSD support and version 5.

    Google Cloud n2-highmem-8 identifies the N2 series, highmem type and 8 vCPUs. Highmem in N2 supplies 8 GB per vCPU, giving 64 GB. The same CPU count can therefore sit beside quite different memory amounts when the type or family changes.

  5. 5
    ChallengeCheck an architecture dependency

    An application is ready for Arm, but its required monitoring agent exists only as an x86 binary. Can the whole deployment move to Graviton unchanged?

    ---reveal---

    No. The required agent must run on the chosen architecture too. Use an Arm-compatible agent or keep an x86 type. A container image packages binaries; it does not convert their instruction set.

  6. 6
    ExplanationMeasure peaks before choosing size

    The reporting service peaks at 1.8 vCPUs of work and 10 GiB of memory. Its disk and network use remain below the measured type limits. The plan adds 25% to both peaks.

    Checking the busiest representative periods matters here: an average across quiet nights could hide the memory peak. Guest memory measurements require an agent because the hypervisor cannot see application memory use.

  7. 7
    ExampleCalculate both requirements

    Add the same planned headroom to each measured resource:

    1.8×1.25=2.25

    The service needs 2.25 vCPUs of capacity.

    10×1.25=12.5

    It also needs 12.5 GiB of memory. A 2-vCPU machine fails the CPU requirement even if it has enough memory. The chosen type must pass both checks.

  8. 8
    ExampleSelect the fitting candidate

    Compare three available candidates: 2 vCPUs/16 GiB, 4 vCPUs/8 GiB and 4 vCPUs/16 GiB.

    The first lacks CPU for 2.25 vCPUs of required work. The second lacks memory for 12.5 GiB. The third meets both requirements. Next check processor compatibility and the exact sustained network and disk limits before testing it with the real workload.

  9. 9
    ExplanationChoose how copies share work

    If demand grows, scaling up moves to a larger type and usually involves a restart. Scaling out adds copies, but those copies need a way to share the job.

    Web servers can share requests through a load balancer; workers can share a queue. Durable sessions and files must survive one copy being removed. A one-node stateful application may instead need a larger instance or a redesigned replication scheme.

  10. 10
    ChallengeCheck a burstable candidate

    A burstable type’s average CPU exceeds its baseline throughout most of the workday. What should you investigate before choosing it for the reporting service?

    ---reveal---

    Calculate credit earnings and spending over that demand pattern. Sustained excess use can drain the balance: standard mode then restricts CPU, while unlimited mode can create surplus charges. Compare fixed-performance capacity for this sustained workload.

  11. 11
    ChallengeCombine sizing with compatibility

    A new cache needs 2 vCPUs and 15 GiB after headroom. Both 2/16 and 4/16 types meet those needs, but the 2/16 option is Arm-only and a required binary is x86-only. What can you select now?

    ---reveal---

    Select a compatible x86 option that meets both requirements, such as the stated 4/16 candidate if it supports x86. The resource fit alone cannot make the Arm-only option usable. Revisit the smaller option when the dependency becomes compatible.

  12. 12
    RecapRecord a reviewable type choice

    For the chosen deployment, record the measured peaks, added headroom, compatible architecture and exact type limits. Keep the test result beside that decision so later changes can be compared against it.

    Before switching the running service, choose a maintenance resize or rolling replacement. If growth uses multiple copies, verify traffic distribution and external state before relying on their combined capacity.

2

Keep enough capacity after a failure

11 steps
Work from rack and maintenance failures to a complete zone-loss capacity calculation.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionChoose the failure to survive
  2. 2
    ExplanationSeparate fault and update domains
  3. 3
    ExampleCount the largest hardware loss
  4. 4
    ChallengeChoose distance or speed
  5. 5
    ExplanationMove the failure boundary to zones
  6. 6
    ExampleFind normal serving capacity
  7. 7
    ExampleCalculate the surviving pool
  8. 8
    TipCheck physical location labels
  9. 9
    ChallengeDistinguish spread from recovery
  10. 10
    ChallengeCombine the failure and capacity choices
  11. 11
    RecapVerify the full surviving service
3

Build and tune a worker scaling group

16 steps
Connect reproducible instances, scaling policies, startup timing and safe worker removal.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionMake scaling useful end to end
  2. 2
    ExplanationPut setup into a repeatable template
  3. 3
    ExplanationGive counts their correct roles
  4. 4
    ChallengeTest a broken application
  5. 5
    ExplanationChoose a signal that changes with capacity
  6. 6
    ExampleEstimate a proportional capacity change
  7. 7
    ConnectionUse known timing before the peak
  8. 8
    ChallengeCheck a proposed scale-in
  9. 9
    ExampleTurn a wait budget into worker count
  10. 10
    ExampleApply the backlog target
  11. 11
    ExplanationDistinguish the timing controls
  12. 12
    TipPrepare for removal while work is active
  13. 13
    ChallengeFind a blocked launch
  14. 14
    ExplanationRoll configuration through the group
  15. 15
    ChallengeCombine quantity, readiness and safe removal
  16. 16
    RecapObserve one full scaling cycle
4

Design a queued report service

16 steps
Choose managed compute, estimate concurrency and keep long-running work safe through retries.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSeparate acceptance from completion
  2. 2
    ExplanationChoose the container’s running unit
  3. 3
    TipPin exactly what replicas run
  4. 4
    ExampleCalculate a queue-driven replica count
  5. 5
    ChallengeCheck what scales underneath tasks
  6. 6
    ExampleEstimate overlapping function work
  7. 7
    ExampleBenchmark memory and duration together
  8. 8
    ExplanationUse the right concurrency control
  9. 9
    ChallengeRespect the HTTP wait
  10. 10
    ExplanationLet the API hand off the job
  11. 11
    ExampleAccount for continued arrivals
  12. 12
    Key InsightProtect one business effect
  13. 13
    ExplanationAllow time before redelivery
  14. 14
    ChallengeExplain a duplicate job
  15. 15
    ChallengeCombine a fast response with a protected database
  16. 16
    RecapCheck the queued service under failure
5

Release a web app with a safe return path

13 steps
Plan shared hosting capacity, prepare slot settings and release a compatible version.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionPrepare code, capacity and configuration
  2. 2
    ExplanationLocate the shared compute pool
  3. 3
    ExampleChoose features before scaling
  4. 4
    TipKeep stateless copies ready
  5. 5
    ChallengeIsolate an intensive staging test
  6. 6
    ExplanationKeep environment settings attached
  7. 7
    ExampleFollow preparation before routing
  8. 8
    TipMake readiness meaningful
  9. 9
    ChallengePrevent a configuration swap error
  10. 10
    ExplanationTry a small share of live traffic
  11. 11
    Key InsightKeep old code compatible with the data
  12. 12
    ChallengeCombine capacity and rollback checks
  13. 13
    RecapDecide from the release evidence
6

Use a load test to choose the next change

12 steps
Build a credible test and diagnose a capacity plateau without confusing correlation with the bottleneck.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionDefine what the run must establish
  2. 2
    ExplanationChoose the appropriate load shape
  3. 3
    ExampleRead more than the average
  4. 4
    ExampleEstimate the virtual-user load
  5. 5
    ChallengeCheck a misleading test workload
  6. 6
    ExampleFind the flattening throughput
  7. 7
    ExplanationUse resource evidence to select a hypothesis
  8. 8
    ChallengeCheck whether more app CPU helps
  9. 9
    ExampleMeasure readiness separately from maximum
  10. 10
    TipInclude the falling side of load
  11. 11
    ChallengeCombine criteria with a controlled comparison
  12. 12
    RecapChoose one measured next step

Auto Scaling practice questions

50 Practice Questions in 5 sets

Set 1: Choose capacity and recognize scaling behavior10 Practice Questions

Question 1 of 10

A cache needs substantially more memory per vCPU than a balanced web server. What instance family is the best starting point?
  1. Compute optimized
  2. Memory optimized
  3. Storage optimized
  4. General purpose
Show answerHide answer
Answer: B
A memory optimized family supplies more memory per vCPU, matching a cache whose memory demand dominates. A larger general purpose instance may also fit, but adds CPU the cache does not need. Storage optimized capacity targets local disk input/output, not the memory-to-CPU ratio.

Question 2 of 10

A service peaks at 2.4 vCPUs of work and 9 GiB of memory. It needs 25% added headroom. What is the smallest fitting size from 2 vCPUs/16 GiB, 4/8, 4/16 and 8/32?
  1. 2 vCPUs and 16 GiB
  2. 4 vCPUs and 8 GiB
  3. 8 vCPUs and 32 GiB
  4. 4 vCPUs and 16 GiB
Show answerHide answer
Answer: D
Adding 25% gives 3 vCPUs and 11.25 GiB, so the smallest fitting candidate is 4 vCPUs with 16 GiB. The 4-vCPU/8-GiB size meets CPU demand but fails the memory requirement. The 8-vCPU/32-GiB size fits but buys more of both resources than needed.

Question 3 of 10

What Azure placement mechanism spreads related VMs across hardware fault domains and planned-maintenance update domains inside a data center?
  1. An availability set
  2. A proximity placement group
  3. A deployment slot
  4. An availability zone
Show answerHide answer
Answer: A
An availability set distributes VMs across fault and update domains within a data center. A proximity placement group instead keeps machines close to reduce communication delay. An availability zone provides a wider placement boundary; it is not the mechanism that assigns a set’s update domains.

Question 4 of 10

A tier must serve 10,800 requests per second immediately after any one of three zones fails. Each instance serves 600 requests per second. With equal placement, what minimum total instance count meets that requirement?
  1. 18 instances
  2. 24 instances
  3. 27 instances
  4. 36 instances
Show answerHide answer
Answer: C
Peak demand needs 18 healthy instances, and only two zones remain after a failure. Each surviving zone therefore needs nine instances, giving 27 across three zones. Eighteen total covers normal load but leaves only twelve after losing one zone; no replacement launches are allowed by the immediate-service requirement.

Question 5 of 10

An EC2 Auto Scaling group replaces VMs with failed status checks, but keeps a VM whose web process has stopped responding. What health-check change addresses this gap?
  1. Increase the group’s health check grace period.
  2. Lower the group’s desired instance count.
  3. Enable load balancer health checks for the group.
  4. Lengthen the load balancer’s deregistration delay.
Show answerHide answer
Answer: C
Enable Elastic Load Balancing health checks so application failures can mark an instance unhealthy for replacement. EC2 status checks alone can pass while the web process is broken. A longer grace period delays health-based action during startup; it does not add application-level failure detection.

Question 6 of 10

Four identical instances average 80% CPU under steady load. A target-tracking policy aims for 50%. Approximately how many instances are needed?
  1. 4 instances
  2. 7 instances
  3. 6 instances
  4. 8 instances
Show answerHide answer
Answer: B
The proportional estimate is 4 times 80 divided by 50, or 6.4 instances, so seven whole instances are needed. Six would leave average CPU near 53.3%, above target. Eight supplies extra headroom, but is not the smallest whole count meeting the estimate for unchanged work.

Question 7 of 10

A team runs a container group on Azure Container Instances and wants to increase its CPU allocation. What must it do?
  1. Delete and recreate the group with the new allocation.
  2. Change a replica rule and keep the group running.
  3. Update the CPU allocation in place without restart.
  4. Create a new revision inside the existing group.
Show answerHide answer
Answer: A
Changing an ACI container group’s CPU allocation requires deleting and recreating the group. Revisions and replica scaling rules belong to Container Apps, a different service. ACI has no built-in autoscaler, so treating it as a revision-based platform leads to the wrong update procedure.

Question 8 of 10

A function receives 720 requests per second and averages 0.3 seconds per execution. What average concurrency does that workload require?
  1. 720 executions
  2. 2,400 executions
  3. 300 executions
  4. 216 executions
Show answerHide answer
Answer: D
Average concurrency is arrival rate multiplied by average duration: 720 times 0.3 gives 216 overlapping executions. Dividing by duration gives 2,400, which is not the number running at once. Requests per second is a rate; concurrency counts work simultaneously in progress.

Question 9 of 10

An Azure web app runs on a Basic App Service plan. It needs metric-based autoscale and staging slots. What is the lowest listed tier that supplies both?
  1. Basic
  2. Standard
  3. Free
  4. Premium v3
Show answerHide answer
Answer: B
Standard is the first tier listed with both autoscale and deployment slots. Basic supplies dedicated compute and manual scale-out, but those resources do not unlock the two required features. Premium v3 also supplies them, though it is a higher tier than the question requires.

Question 10 of 10

A test must reveal whether a service can bring new capacity online quickly enough when traffic suddenly increases. What test shape best answers that question?
  1. A soak test at stable normal demand
  2. A load test held at the usual peak
  3. A stress test with a slow load ramp
  4. A spike test with a sudden load jump
Show answerHide answer
Answer: D
A spike test creates the abrupt demand change needed to expose the gap before new capacity becomes ready. A steady peak load test can show sustainable capacity after scaling settles, while hiding the startup delay. A long soak test mainly reveals slower resource growth under sustained use.
Set 2: Apply policies and release changes safely10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A team can deploy an application only on x86 because one required agent has no Arm build. What does that mean for moving the workload to AWS Graviton?
  1. The move works if the application container contains all libraries.
  2. The move works if enough additional vCPUs are allocated.
  3. The agent blocks the move until an Arm-compatible replacement exists.
  4. The agent can remain unchanged because a vCPU is architecture-neutral.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A 2-vCPU burstable instance earns 24 credits per hour. At a sustained 50% CPU it spends 60 credits per hour. With 180 credits available, how long until the balance reaches zero?
  1. 5 hours
  2. 3 hours
  3. 7.5 hours
  4. 2.5 hours
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

An availability set contains 11 web VMs distributed 4/4/3 across fault domains. Peak traffic requires six VMs. After one fault domain fails, what capacity remains in the worst case?
  1. 6 VMs, exactly enough for peak demand
  2. 8 VMs, enough for peak demand
  3. 4 VMs, insufficient for peak demand
  4. 7 VMs, enough for peak demand
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A promotion begins at a known time, and new instances need several minutes to start. What policy can prepare capacity before customers arrive?
  1. Target tracking after CPU rises
  2. Scheduled scaling before the promotion
  3. Simple scaling after an alarm fires
  4. Step scaling after request load rises
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Serial workers average 0.4 seconds per message. A 24-second queue-wait budget applies, 1,260 messages are waiting, and the group maximum is 18. What change lets the group reach the computed worker target?
  1. Keep the maximum at 18 and lower the minimum.
  2. Raise the maximum to at least 21 workers.
  3. Raise the maximum to at least 30 workers.
  4. Keep the maximum at 18 and lengthen cooldown.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

An order-created event must reach both billing and customer notifications, with each service receiving its own copy. What messaging pattern fits?
  1. Publish/subscribe with separate subscriptions
  2. A queue shared by competing consumers
  3. A single queue consumer that handles either task
  4. A synchronous chain from billing to notifications
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Three apps share a plan that grows from two instances to six. Only the reporting app needs the extra capacity. How can it gain independent scaling and separate compute resources?
  1. Create a reporting slot inside the current shared plan.
  2. Turn on Always On for the two smaller applications.
  3. Turn off ARR affinity for the reporting application.
  4. Move the reporting app into its own App Service plan.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A staging slot uses a test database, while production uses the live database. How should the connection strings be configured so each slot retains its intended value after a swap?
  1. Leave the connection strings as ordinary swapping settings.
  2. Put both connection strings in the new code bundle.
  3. Mark the connection strings as deployment slot settings.
  4. Change only the production slot’s public hostname.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A steady system completes 160 requests per second with a mean response time of 0.5 seconds. Each virtual user waits another 2.5 seconds before sending the next request. About how many virtual users generate that rate?
  1. 80 virtual users
  2. 400 virtual users
  3. 320 virtual users
  4. 480 virtual users
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A test steps offered load from 800 to 1,200 to 1,600 requests per second. Delivered throughput is 800, 1,170 and 1,180; p95 is 120, 380 and 1,900 ms. App CPU stays at 25%, while database connections reach their limit at 1,200 offered. What should be investigated first?
  1. App CPU capacity above the 1,600-request load step.
  2. Warm-up time of newly launched app instances.
  3. Database connection waits near the throughput plateau.
  4. The choice of a lower p95 threshold for the test.
Show answerHide answer

Save this lesson to see this answer.

Set 3: Connect capacity, retries and observed performance10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

In the Azure size name Standard_E8s_v5, what does the number 8 identify?
  1. The number of vCPUs
  2. The memory size in GiB
  3. The temp disk count
  4. The CPU generation
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Two AWS accounts both use a zone named us-east-1b and need their instances in the same physical zone. What identifier should they compare?
  1. The matching zone name
  2. The regional subnet name
  3. The Availability Zone ID
  4. The instance launch-template version
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

An AWS group has 30 instances and performs a refresh with no surge capacity and a 90% minimum healthy setting. How many instances can be unavailable for replacement at once?
  1. 2 instances
  2. 27 instances
  3. 5 instances
  4. 3 instances
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Six ready instances average 90% CPU with a 60% target. Added instances need three minutes to help; repeated alarms cause excess launches during startup, though health grace is already adequate. What full ready count and timing control address the shortfall without changing health detection?
  1. Nine ready instances; tune instance warmup.
  2. Six ready instances; tune instance warmup.
  3. Nine ready instances; lengthen health grace.
  4. Twelve ready instances; lengthen health grace.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A Container Apps queue rule targets 25 waiting messages per replica. There are 140 waiting messages, minimum is zero and maximum is ten. What count does the ratio request after rounding?
  1. 5 replicas
  2. 6 replicas
  3. 10 replicas
  4. 4 replicas
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

During a brief burst, a Lambda function receives 900 requests per second and averages 0.4 seconds. Its downstream store permits 250 simultaneous connections, one per execution. What combination accepts burst work for later processing while respecting the connection limit?
  1. Reserve 360 concurrent executions and let all connect directly.
  2. Provision 360 environments and leave concurrency uncapped.
  3. Increase memory without measuring duration or connection use.
  4. Buffer excess work in a queue and cap concurrency at 250.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A worker may receive the same payment message again after a retry. What property keeps the repeated delivery from creating another payment?
  1. Longer draining period
  2. Idempotent processing
  3. Reserved concurrency
  4. Random message routing
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A slot swap introduces errors, and swapping back restores the old code. The new release also removed a database column required by the old code. Why can the rollback still fail?
  1. The reverse swap always keeps the new code in production.
  2. The staging hostname prevents old code from reaching any database.
  3. The reverse swap does not restore the removed database column.
  4. The production identity must move to staging before code can run.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

During a spike, traffic rises to 4,200 requests per second. Each instance supports 350, three instances are running, and startup takes five minutes. The group maximum is twenty. What change best addresses the immediate capacity gap for a known scheduled spike?
  1. Pre-scale to twelve ready instances before the event.
  2. Raise the maximum from twenty to thirty instances.
  3. Wait five minutes before evaluating the CPU metric.
  4. Replace the scale-out rule with a slower cooldown.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A soak test shows gradually increasing memory while throughput stays steady. What observation would help distinguish a leak from normal cache growth?
  1. Whether CPU averages less than its configured scaling threshold.
  2. Whether retained objects keep accumulating after the cache stabilizes.
  3. Whether a short spike test finishes before scale-out begins.
  4. Whether the instance family has a higher network burst limit.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Diagnose limits across a running architecture10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A test records 40 sorted response times. Using the nearest-rank method, which position is p95?
  1. The 38th value
  2. The 39th value
  3. The 20th value
  4. The 40th value
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A service peaks at 2.8 vCPUs and 14 GiB; add 25% headroom to both. It also needs 3.6 Gbit/s sustained network capacity and an x86-only agent. What candidate meets all requirements?
  1. x86: 4 vCPUs, 16 GiB, 4 Gbit/s sustained network
  2. Arm: 4 vCPUs, 32 GiB, 5 Gbit/s sustained network
  3. x86: 4 vCPUs, 32 GiB, 3 Gbit/s sustained network
  4. x86: 8 vCPUs, 32 GiB, 5 Gbit/s sustained network
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A tightly coupled simulation needs the lowest communication latency between EC2 instances in one zone. What placement strategy fits that priority?
  1. Spread placement
  2. Partition placement
  3. Cluster placement
  4. Multi-zone placement
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

An Azure tier has six instances in each of three zones, each serving 400 requests per second. Peak is 6,000. Strict balancing blocks recovery scale-out during a zone outage. What minimum equal-placement total would sustain peak immediately after any one zone fails?
  1. 18 ready instances, six per zone
  2. 24 ready instances, eight per zone
  3. 21 ready instances, seven per zone
  4. 30 ready instances, ten per zone
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Azure autoscale cannot read metrics. Current capacity is three, minimum is two, default is five and maximum is nine. What fallback capacity should it raise to?
  1. 5 instances
  2. 2 instances
  3. 3 instances
  4. 9 instances
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

An Azure profile has two active scale-out rules proposing counts of nine and twelve. Current capacity is eight and the profile maximum is ten. What resulting count follows the rule combination and limit?
  1. 9 instances
  2. 12 instances
  3. 8 instances
  4. 10 instances
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A long-running worker must survive scale-in without restarting its whole job. What design supports continued progress if the instance is eventually replaced?
  1. Store regular checkpoints outside the instance.
  2. Increase the load balancer deregistration delay.
  3. Keep partial results in the local temp directory.
  4. Set the group minimum equal to its maximum.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A function uses 1 GB for 1.2 seconds. A measured alternative uses 2 GB for 0.5 seconds. Under the same per-GB-second compute rate, what changes in duration and memory-duration use?
  1. Duration falls; memory-duration rises from 1.2 to 2.0 GB-seconds.
  2. Duration falls; memory-duration falls from 1.2 to 1.0 GB-seconds.
  3. Duration rises; memory-duration falls from 1.2 to 1.0 GB-seconds.
  4. Duration falls; memory-duration stays fixed at 1.2 GB-seconds.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

An App Service app must reach a database through a virtual network. What App Service feature provides the outbound network path?
  1. An inbound private endpoint
  2. A custom-domain TXT record
  3. Virtual network integration
  4. A deployment slot’s hostname
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A run reports flat throughput even as requested load increases. The load generators are at 100% CPU, but server CPU and connection use stay low. What should be fixed before judging the service’s capacity?
  1. Add application instances and keep the same generators.
  2. Raise the service’s CPU target to postpone autoscaling.
  3. Lower the request-rate threshold until the run passes.
  4. Add generator capacity and verify the delivered request rate.
Show answerHide answer

Save this lesson to see this answer.

Set 5: Make combined design decisions under changing load10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

An app needs 1.6 vCPUs and 18 GiB at peak before 25% headroom. Candidate sizes are 2/16, 4/16, 4/32 and 8/32 vCPUs/GiB. What is the smallest fitting candidate?
  1. 2 vCPUs and 16 GiB
  2. 4 vCPUs and 32 GiB
  3. 4 vCPUs and 16 GiB
  4. 8 vCPUs and 32 GiB
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A tier has 18 instances, six per zone across three zones. Each handles 500 requests per second. Peak is 7,000, replacement takes four minutes and peak must continue immediately after any zone loss. What minimum equal-placement total meets the requirement?
  1. 21 instances, seven per zone
  2. 18 instances, six per zone
  3. 24 instances, eight per zone
  4. 15 instances, five per zone
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Six identical instances average 40% CPU. Scale-out occurs above 70%, and total work stays unchanged. What is the largest scale-in removal that avoids crossing that scale-out threshold, and what CPU level results?
  1. Remove three instances; the survivors average 80%.
  2. Remove four instances; the survivors average 60%.
  3. Remove two instances; the survivors average 60%.
  4. Remove one instance; the survivors average 48%.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A system has repeatable daily peaks, slow startup and an AWS predictive scaling policy. What companion policy handles unexpected demand and removes excess instances afterward?
  1. A forecast-only predictive policy
  2. A permanently fixed desired count
  3. A launch-template version change
  4. A dynamic target-tracking policy
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Serial workers take 0.75 seconds per message. The queue-wait budget is 45 seconds, 1,800 messages wait, and maximum is forty workers. Instances need four minutes to start, but the budget must hold for a known event from its first moment. What is the minimum ready worker count, and when must it be in place?
  1. Have thirty workers ready before the event.
  2. Allow thirty workers to launch after the event begins.
  3. Have forty workers ready and raise maximum to eighty.
  4. Launch sixty workers and halve the cooldown.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A Container Apps service uses only CPU-based scaling and minimum zero. After all replicas stop, what change allows queued jobs to wake the service while keeping scale-to-zero?
  1. Lower the CPU threshold while leaving all replicas stopped.
  2. Raise maximum replicas without changing the CPU rule.
  3. Increase CPU allocation on the currently stopped replicas.
  4. Add a queue-based scaler that can observe waiting jobs.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

What Lambda setting keeps execution environments initialized to reduce cold-start delay?
  1. Reserved concurrency
  2. Provisioned concurrency
  3. The function timeout
  4. The regional concurrency quota
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A report API must acknowledge jobs quickly, processing takes six minutes, and retries can reach different workers. What design handles the response and prevents duplicate committed effects?
  1. Return 202 with a status URL, queue jobs and rely on visibility timeout.
  2. Hold the request until the report completes, keyed by a stable job ID.
  3. Return 202 with a status URL, queue jobs and commit effects idempotently.
  4. Return 202 with a status URL, queue jobs and track seen IDs in worker memory.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A staging version passes tests, but production must stay at full serving capacity during deployment and retain a workable rollback. Both versions use the same database. What release plan meets those needs?
  1. Use all-at-once deployment and restore only the code if errors appear.
  2. Use warmed replacement capacity and a schema compatible with both versions.
  3. Use rolling batches without spare capacity and remove old columns first.
  4. Run a heavy staging load test on the shared plan during the production peak.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

After connection pooling is enabled, a repeated test has lower p95 but a higher error rate that breaches the existing pass criterion. How should the result be judged?
  1. The run passes because p95 is the main metric.
  2. The run passes if mean latency also decreases.
  3. The run fails despite its lower p95 latency.
  4. The run is valid only after removing the error threshold.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

90 Key Terms, each with its definition

A

Always On
Always On is an App Service setting that keeps an application loaded during idle periods and supports continuously running WebJobs.
Always On prevented the background job’s application from unloading while no web requests were arriving.
App Service plan
An App Service plan is the compute allocation for Azure web apps, setting region, operating system, tier, instance size and instance count.
A separate App Service plan let the reporting app scale without competing with smaller sites for resources.
Arm
Arm is a processor architecture used by instances such as AWS Graviton, requiring compatible binaries, images and runtime dependencies.
An Arm deployment was delayed until the vendor supplied a compatible build of the required agent.
ARR affinity
ARR affinity is App Service session affinity that pins a client’s requests to one instance, affecting how load is distributed.
The stateless API disabled ARR affinity so new requests could spread across the available instances.
Asynchronous request-reply
Asynchronous request-reply accepts a job quickly and provides a way to retrieve its later result, commonly using HTTP 202 and a status URL.
Asynchronous request-reply let a report API respond promptly while a worker performed a job that took six minutes.
Auto Scaling group
An Auto Scaling group is an AWS collection that creates and replaces instances from a launch template to maintain its desired capacity.
The Auto Scaling group replaced a failed instance using the same configuration as the healthy copies.
Autoscale profile
An autoscale profile is an Azure collection of capacity bounds and rules activated by a default, recurring or fixed-date schedule.
A fixed-date autoscale profile overrode the normal weekday profile for the planned one-day event.
Availability set
An availability set is an Azure grouping that distributes related VMs across hardware fault domains and maintenance update domains.
Two application VMs joined the availability set when they were created, before production traffic began.
Availability zone
An availability zone is one or more separate data centers within a region, with independent power, cooling and networking.
The compute tier kept copies in each availability zone so one zone’s outage would leave serving instances.
AZ ID
An AZ ID is an AWS identifier that consistently names one physical availability zone across accounts, unlike account-mapped zone names.
The two teams compared the AZ ID before deciding whether their subnets occupied the same physical zone.

B

Backlog per instance
Backlog per instance is the number of waiting messages divided by running workers, expressing the work each worker must help clear.
Backlog per instance doubled when half the workers were removed while the waiting message count stayed fixed.
Backward-compatible schema
A backward-compatible schema remains usable by the previous code version, preserving a working rollback path while new code is released.
A backward-compatible schema kept the old release working after the new version added database fields.
Binding constraint
A binding constraint is the resource limit that first restricts useful throughput, even when other resources still have spare capacity.
Network throughput became the binding constraint while the service’s CPU remained mostly idle.
Blue/green release
A blue/green release keeps old and new application environments available and changes the traffic entry point to switch between them.
The blue/green release switched environment URLs after the new environment passed its serving checks.

C

Canary release
A canary release sends a limited share of live traffic to a new version before increasing its exposure based on observed behavior.
The canary release routed a small percentage of users to staging while the team compared errors and latency.
Capacity knee
A capacity knee is the region where delivered throughput flattens while latency rises sharply as a system’s limiting resource saturates.
The capacity knee appeared near the same load step where the database connection pool became full.
Checkpoint
A checkpoint is saved progress outside a running worker that lets another execution resume a long job after interruption.
The worker wrote a checkpoint before termination so its replacement could continue without repeating all processing.
Cluster placement group
A cluster placement group is an AWS arrangement that keeps instances close in one zone for low latency and high communication throughput.
The simulation used a cluster placement group because its workers frequently exchanged large amounts of data.
Cold start
A cold start is the initialization delay when a request needs a new execution environment before its function handler can run.
The first request after idle experienced a cold start while the runtime loaded and initialization completed.
Compute optimized family
A compute optimized family supplies more CPU relative to memory, fitting workloads whose processing demand dominates their memory use.
The encoding service tested a compute optimized family because CPU saturated while memory stayed low.
Concurrency
Concurrency is the number of requests or executions in progress at the same moment, distinct from the arrival rate per second.
Concurrency rose when execution time increased, even though the function’s incoming request rate stayed fixed.
Connection draining
Connection draining stops new requests reaching a departing instance while allowing requests already in progress time to finish.
Connection draining let active downloads finish before the web instance was removed from the group.
Container group
A container group is the ACI running unit whose containers share a host, network and lifecycle, with specified resource allocations.
The container group was recreated when its job required a larger CPU allocation and more memory.
Container registry
A container registry stores versioned container images so deployment platforms can retrieve the application package they need to run.
The container registry held the approved image digest used by every replica of the new application revision.
Cooldown
A cooldown is a waiting period after a scaling action that limits how quickly the associated policy or rule responds again.
The cooldown gave added capacity time to affect measurements before another adjustment was considered.
CPU credit
A CPU credit on AWS burstable instances funds one vCPU at full utilization for one minute, allowing short use above the CPU baseline.
The development server accumulated each CPU credit during quiet periods and spent credits during builds.
Custom machine type
A custom machine type is a supported Google Cloud configuration with a chosen vCPU count and memory amount instead of a predefined ratio.
The team tested a custom machine type when standard memory ratios left too much unused capacity.

D

Dead-letter queue
A dead-letter queue stores messages that exceed the allowed processing attempts, separating repeated failures for later investigation.
The dead-letter queue collected malformed jobs while ordinary messages continued through the worker pool.
Decoupling
Decoupling separates components with messages or events so one can accept work without requiring the next component to finish immediately.
Decoupling let the API accept report requests while the slower processing service worked through a queue.
Deployment slot
A deployment slot is a live App Service application version with its own hostname that shares the parent app’s hosting plan.
The deployment slot hosted the new version for checks before production routing moved to it.

F

Fault domain
A fault domain is a set of hardware sharing a power source and network switch, so one hardware failure can affect all its VMs.
The service retained enough capacity after losing the fault domain containing its largest VM group.
Flapping
Flapping is repeated reversal between scaling out and scaling in because a capacity change triggers the opposite rule soon afterward.
Flapping occurred when removing one server pushed CPU high enough to request that server back.

G

GB-second
A GB-second is a memory-duration usage unit equal to one gigabyte allocated for one second, used to compare function compute consumption.
Of two function configurations, the faster used fewer GB-seconds because its shorter runtime outweighed its larger memory setting.
General purpose family
A general purpose family balances processor and memory resources for workloads that do not strongly favor one resource over the other.
A balanced web service used a general purpose family after measurements showed moderate CPU and memory use.

H

Headroom
Headroom is planned spare capacity above measured demand, allowing a workload to grow or vary without immediately reaching its limit.
The design added 25% headroom to both peak CPU demand and peak memory use before selecting a size.
Health check grace period
A health check grace period gives a newly started instance time to initialize before startup health failures cause replacement.
The health check grace period was extended to match observed application startup, avoiding replacement loops.
Horizontal scaling
Horizontal scaling is changing the number of instances sharing a workload, which requires a way to distribute work and handle state.
Horizontal scaling added web copies behind the load balancer while sessions stayed in an external store.

I

Idempotency
Idempotency is the property that repeated processing of the same work produces the same business effect as one successful processing.
Idempotency kept a retried payment message from creating a second charge for the same order.
Image digest
An image digest is a content-derived identifier for a specific container image, preventing a reused tag from changing deployed content.
The deployment pinned the image digest so replicas created later would download the same application code.
Instance refresh
An instance refresh is an AWS replacement process that rolls a selected configuration through a group while controlling healthy capacity.
The instance refresh introduced the new image in small batches while the rest of the group kept serving.
Instance type
An instance type is a provider-defined bundle of virtual CPUs, memory, network capacity and sometimes local disks or accelerators.
The API team compared each instance type’s memory and network limits before running its benchmark.
Instance warmup
Instance warmup is an AWS period controlling when new-instance metrics enter the group aggregate while their capacity already counts.
Instance warmup reduced repeated launches while newly started workers settled into their normal CPU use.

L

Launch template
A launch template is an AWS definition of instance configuration, including image, type, security settings, identity and startup data.
Updating the launch template ensured the next replacement instance included the corrected startup script.
Lifecycle hook
A lifecycle hook pauses an AWS instance launch or termination transition so custom setup or cleanup work can complete.
A termination lifecycle hook allowed the worker to preserve logs and stop taking messages before exit.
Little’s law
Little’s law links average work in progress to throughput multiplied by average time in the system under stable operating conditions.
Little’s law estimated active requests, while think time was added separately to size the virtual-user pool.
Load test
A load test holds expected traffic for a sustained period to check whether latency, throughput and errors meet the service target.
The load test held the planned peak for thirty minutes instead of ending as soon as autoscaling began.

M

Managed instance group
A managed instance group is a Google Cloud collection that creates VM instances from a template and manages scaling, repair and updates.
A regional managed instance group distributed its application VMs across zones in the chosen region.
Memory optimized family
A memory optimized family provides a high amount of memory per vCPU for workloads such as large caches and in-memory processing.
The cache moved to a memory optimized family to gain memory without buying large amounts of idle CPU.

P

Partition placement group
A partition placement group is an AWS arrangement dividing instances among rack-separated partitions that a replicated system can use.
The replicated data service used partition placement group information to separate dependent replicas.
Pass criterion
A pass criterion is a predefined performance requirement combining workload and measurement limits so a test has a clear success decision.
The pass criterion required low p95 latency and errors below the limit throughout the full peak interval.
Per-app scaling
Per-app scaling limits how many plan instances run each App Service app without creating a separate underlying compute pool.
Per-app scaling kept two small apps on fewer instances while a busy app used more of the shared plan.
Percentile
A percentile is a position in sorted measurements indicating the value at or below which a specified share of observations lies.
The 95th percentile exposed slow requests that were hidden by the service’s much lower mean response time.
Performance regression
A performance regression is a deterioration in speed, capacity or errors compared with a prior result under a comparable workload.
The release gate caught a performance regression when the same workload produced higher p95 latency.
Predictive scaling
Predictive scaling uses historical workload patterns to forecast demand and prepare capacity before the expected load arrives.
Predictive scaling helped a slow-starting service prepare for its repeating weekday traffic peak.
Private endpoint
A private endpoint provides private inbound access to an App Service app through a network interface in a virtual network.
The private endpoint let approved internal clients reach the app without using its public entry path.
Provisioned concurrency
Provisioned concurrency is paid Lambda capacity kept initialized so requests can start without waiting for execution-environment setup.
Provisioned concurrency reduced startup delay for a latency-sensitive API during its scheduled busy window.
Publish/subscribe
Publish/subscribe is messaging in which each subscription receives its own copy of an event, allowing independent reactions to that event.
Publish/subscribe delivered the order event separately to the billing service and the notification service.

Q

Queue-based load leveling
Queue-based load leveling stores incoming work during bursts so consumers can process it at a rate supported by available capacity.
Queue-based load leveling absorbed the short arrival burst without forcing every worker to run at the peak rate.

R

Replica
A replica is one running copy of a Container Apps revision, added or removed as the platform follows the revision’s scaling rules.
Each replica processed part of the waiting work, so queue-driven scaling increased the number of workers.
Reserved concurrency
Reserved concurrency is a Lambda setting that guarantees one function a share of the regional concurrency pool and caps it at that share.
Reserved concurrency limited the number of function executions that could open database connections at once.
Revision
A revision is a deployed version of an application configuration that can coexist with another version for scaling or traffic routing.
The new revision received a small share of live traffic while the team checked its error rate.
Right-sizing
Right-sizing is choosing the smallest compute type that meets a workload’s performance target with an explicit allowance for headroom.
Right-sizing used the busiest two weeks’ measurements, including memory, network and disk demand.

S

Scale to zero
Scale to zero is reducing a managed application to no running replicas when idle, with an external trigger needed to start it again.
Scale to zero removed idle replicas, while the queue scaler still observed jobs arriving for processing.
Scale-in protection
Scale-in protection prevents a selected instance from being removed by an ordinary group scale-in action while it handles important work.
Scale-in protection preserved the worker running a long job until it could safely save a checkpoint.
Scheduled scaling
Scheduled scaling changes capacity settings at specified times, allowing resources to become ready before known changes in demand.
Scheduled scaling raised the minimum before the daily registration window opened to customers.
Service level agreement
A service level agreement is a provider commitment describing service availability and the conditions under which that commitment applies.
The VM service level agreement differed between a single VM and multiple VMs spread across zones.
Slot setting
A slot setting is an app setting or connection string marked to retain its final value with its slot after a deployment swap.
The database slot setting kept staging pointed at test data after the new code moved into production.
Soak test
A soak test maintains load for hours to reveal slow resource growth, exhaustion or behavior that a short performance run can miss.
The soak test showed memory rising long after the normal startup and cache-loading period had finished.
Spike test
A spike test abruptly increases demand to reveal response degradation and the delay before added capacity becomes useful.
The spike test exposed four minutes of slow responses while new application instances initialized.
Spot capacity
Spot capacity is discounted compute that a provider can reclaim, suitable for recoverable work and supplementary stateless capacity.
Spot capacity processed restartable jobs above a regular-capacity base that preserved essential service.
Spread placement group
A spread placement group is an AWS arrangement placing each instance on separate racks, with a limit of seven running instances per zone.
A few critical servers used a spread placement group to reduce their exposure to a shared rack failure.
Stateless function
A stateless function keeps durable business state outside its execution environment so reuse or replacement does not determine correctness.
The stateless function read job status from a database instead of relying on memory from a previous invocation.
Static stability
Static stability is having enough capacity already running to meet required demand after a failure without launching replacement capacity.
When one of three zones became unavailable, static stability kept peak traffic served while operators investigated.
Step scaling
Step scaling is a policy that applies different capacity adjustments depending on how far a measured value exceeds an alarm threshold.
Step scaling added a larger batch when CPU rose far above the alarm threshold during an unexpected peak.
Swap with preview
A swap with preview applies target configuration to the source slot and pauses for validation before production routing is switched.
The team used swap with preview to check the new release with production configuration before completing it.

T

Target tracking
Target tracking is a scaling policy that adjusts capacity to keep a suitable load-per-instance metric near a configured target.
Target tracking added workers as waiting messages per worker rose above the chosen delay-based target.
Task definition
A task definition is an ECS specification for running containers, including image, CPU, memory, ports and the task’s identity role.
The task definition selected a valid Fargate CPU/memory pair before the service launched its new tasks.
Think time
Think time is the pause between a simulated user receiving a response and starting the next action in a performance-test workload.
Longer think time required more virtual users to maintain the same number of requests per second.
Throttling
Throttling limits accepted or executed work when a quota or configured rate or concurrency bound has been reached.
Throttling produced HTTP 429 responses after the function reached its available concurrency allowance.
Throughput
Throughput is the rate of useful completed work, such as successful requests per second, measured over a stated time interval.
Throughput stopped rising even as offered traffic increased, showing that additional requests were waiting or failing.

U

Update domain
An update domain is a group of Azure VMs that the platform can restart together during planned maintenance activities.
In a set of web VMs, the largest update domain contained two of them, leaving the other copies available during maintenance.

V

vCPU
A vCPU is a virtual processor allocated to an instance; its relationship to a physical core depends on the processor architecture.
The benchmark measured useful work per vCPU because equal counts did not give equal application speed.
Vertical scaling
Vertical scaling is changing to a larger or smaller instance size, altering resources on one machine and commonly requiring a restart.
The database’s vertical scaling was scheduled during a maintenance window because the VM had to restart.
Virtual Machine Scale Set
A Virtual Machine Scale Set is an Azure resource for managing groups of VMs with shared deployment, placement and scaling controls.
The Virtual Machine Scale Set used Flexible orchestration to manage standard VMs across its selected zones.
Virtual network integration
Virtual network integration provides an App Service app an outbound path to resources reached through the integrated virtual network.
Virtual network integration allowed the web app to connect to its privately addressed database.
Visibility timeout
A visibility timeout is the SQS interval during which a received message stays hidden from other consumers while processing is attempted.
The visibility timeout expired before the slow job finished, allowing another worker to receive its message.

W

Warm pool
A warm pool is a set of pre-initialized AWS instances kept ready to enter an Auto Scaling group faster than fresh launches.
A warm pool shortened the launch-to-serving interval for the application’s slow initialization routine.
Warm-up
Warm-up prepares an application instance to serve requests, including initialization and readiness checks before production routing changes.
The warm-up endpoint returned an accepted status only after the application had loaded its required resources.

Z

Zonal resource
A zonal resource occupies one selected availability zone, so its availability depends on that zone’s continued operation.
The design review found that a zonal resource holding shared cache data could still stop the web tier.
Zone-redundant resource
A zone-redundant resource is distributed across availability zones by its platform so it can tolerate the loss of a zone.
The team selected a zone-redundant resource for the load balancer front end serving its multi-zone tier.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started