Match compute size and placement to the bottleneck
Measure CPU, memory, accelerator, duration, framework, and connectivity needs before choosing compute family, size, service, or Regional and edge placement.
LESSON GOALS
By the end, you can
- Match compute service, instance family, and resource size to the measured bottleneck and workload shape.
- Choose Regional, viewer-edge, on-premises, or device-local placement from latency and disconnection requirements.
01
Measure the resource envelope before sizing
A bigger compute unit is not automatically faster. First identify whether CPU, memory, storage, network, accelerator, startup, or concurrency limits the completed work. Sizing starts with a workload profile: request or batch, duration, concurrency, CPU saturation, memory working set, network and EBS throughput, local scratch, accelerator need, startup latency, and geographic placement. Record p50 and p95 behavior, not one average.
For EC2, the measured bottleneck chooses the family: compute-, memory-, storage-, or accelerator-oriented. Size must also respect instance network and EBS ceilings. A larger general-purpose instance is not sound when memory pressure or GPU support decides. For Lambda, memory is also a performance control because AWS allocates CPU in proportion to memory.
Test settings against duration, timeout, and completed-work cost rather than assuming the smallest costs least. For Fargate containers, select a supported CPU-memory task shape and account for startup and ephemeral storage. Retain headroom for bursts and failure, then validate with load tests. Right-sizing is a loop: hypothesize the bottleneck, change one resource dimension, and confirm target latency or throughput.
02
Choose compute from the shape of the work
Online requests, finite queued jobs, distributed frameworks, and local device loops are different work shapes. Choose the service after naming the shape. EC2 is control-rich for long-running services, specialized hardware, tightly coupled nodes, and OS requirements. Lambda suits bounded event or request work without host control. AWS Batch schedules finite queued jobs onto supported compute environments; it is not an online API tier.
EMR is purpose-built for distributed frameworks such as Spark and Hadoop, where partitions, executors, shuffle, and data locality determine performance. Fargate runs containers without host provisioning, but does not turn an algorithm into EMR or a queue into Batch. Distributed computing changes placement. Cluster placement groups support tightly coupled EC2 nodes needing low-latency, high-throughput communication, but must be weighed against failure isolation.
Global or edge placement helps only when compute near users or data reduces the measured path. Lambda@Edge is for supported CloudFront event code, not a disconnected plant controller. AWS Outposts extends AWS infrastructure, services, APIs, and tools to customer premises for workloads needing local processing or low latency; its capacity, supported services, parent-Region dependencies, installation, and operations must be evaluated.
AWS IoT Greengrass runs components on edge devices so they can collect and process data locally, communicate on local networks, and continue operating with intermittent cloud connectivity. That makes Greengrass a current candidate for device-oriented local logic, not a substitute for every Regional service.
03
Test the whole path—including disconnected operation
A compute choice is incomplete until its dependencies, placement, security, failure headroom, and completed-work cost are tested together. More vCPU does not help a memory-bound API; more Lambda concurrency does not shorten one CPU-bound invocation; more executors do not cure a skewed Spark partition; faster instances do not overcome a database connection ceiling.
Compare throughput per unit, startup time, tail latency, queue age, failure headroom, and total cost under realistic data. Security and operations remain constraints: select architectures and images the organization can patch and observe; place sensitive compute in appropriate network boundaries; use roles and certificate-backed device identities rather than static credentials. Resilience requires enough capacity after an instance or AZ loss, not merely at average load.
Cost should use completed work at the SLO, including local hardware, installation, fleet support, software rollout, data transfer, and idle headroom. Edge placement is not one category. Lambda@Edge can remove a viewer-to-Region trip for bounded CloudFront request or response transformations, but it does not host arbitrary long-running work or preserve a local control loop during WAN loss.
AWS Snowball Edge is no longer available to new customers. Existing customers must still verify eligibility and supported behavior; a new architecture must not select it as generally orderable local compute.
Current choices start with the operating model: Outposts supplies AWS infrastructure on premises for compatible workloads that need local processing, while Greengrass deploys and manages software components on edge devices and supports local processing during intermittent connectivity. For disconnected execution, partition state deliberately.
Cache only the inputs and policy needed for the outage window, authenticate devices locally without embedding long-lived secrets, journal accepted work with stable operation identifiers, and synchronize through an encrypted channel after reconnection. Reconciliation must be idempotent because acknowledgments can be lost.
During a WAN-loss drill, confirm that local inspection continues, unauthorized software is rejected, queued results remain encrypted, and each operation reaches the Regional system of record once after reconnection.
Regional compute becomes preferable when continuous connectivity meets the deadline and centralized operations cost less; Outposts becomes preferable when a larger compatible AWS stack and on-premises infrastructure justify its operational commitment; Greengrass wins for compact device-local processing that must tolerate intermittent links.
DECISION TABLE
Compare the architecture constraints
| requirement | choose | because | reject |
|---|---|---|---|
| Memory pressure and swap dominate an API | Memory-optimized EC2 sized from p95 working set | It targets the measured resource | More general-purpose CPU does not remove memory pressure |
| Finite independent container jobs in a queue | AWS Batch | It schedules queued jobs and capacity | An ECS service is not a job scheduler; EMR is framework-specific |
| Large Spark transformation | Amazon EMR | It manages the distributed data framework | Batch alone does not supply Spark semantics |
| CPU-bound Lambda with acceptable initialization | Increase and benchmark Lambda memory | Memory also increases CPU | Provisioned concurrency targets initialization |
| Device inspection must continue through an eight-hour WAN outage | AWS IoT Greengrass local components with an idempotent synchronization journal | Device-local processing and intermittent-connectivity operation fit the failure condition | Regional-only compute stops at link loss; Snowball Edge is unavailable to new customers |
GUIDED WORKED SCENARIO
Reason from the stated constraints
This is a guided example, not a question to memorise. The knowledge check uses new situations to test the same reasoning.
An application has a memory-bound API, 2,000 independent ten-minute transcodes nightly, and a 40 TB Spark aggregation. A new factory also inspects 30 images per second and must keep accepting signed inspection policy for eight hours without WAN connectivity.
Requirements
- Keep API p95 below 200 ms with 30% failure headroom
- Finish transcodes within six hours and run Spark with framework-aware distributed execution
- Run a bounded viewer-request rewrite near CloudFront viewers
- Keep factory inspection operating for an eight-hour WAN outage and synchronize each result once after reconnection
- Authenticate local software and devices, encrypt queued results, and reject unsigned component updates
- Avoid Kubernetes and include local hardware, fleet operations, synchronization, and idle capacity in cost
Reasoning path
- Split online, queued, distributed, viewer-edge, and disconnected device work before sizing.
- Use memory-optimized EC2 for the measured API bottleneck, Batch for finite transcodes, and EMR for Spark semantics.
- Keep the CloudFront rewrite in Lambda@Edge, where its supported event and network-path benefit apply.
- Choose Greengrass components on factory devices, provision outage-window storage, and journal stable operation identifiers.
- Validate signed deployments, local authorization, encrypted queues, idempotent reconciliation, fleet monitoring, and total local operating cost.
Why it wins
- Each Regional or viewer-edge service matches its measured work model and placement boundary.
- Greengrass keeps the device-local inspection path operating while signed deployment, encrypted journaling, and idempotent synchronization protect the disconnected boundary.
- The cost comparison includes Regional capacity plus local device fleet deployment, storage, support, and reconciliation operations.
Why the alternatives lose
An eight-hour WAN interruption stops the inspection path and violates the local availability objective.
Becomes correct when: Continuous WAN latency is proven inside the inspection deadline and link loss is removed from scope.Snowball Edge is no longer available to new customers, so it is not a selectable new-customer architecture.
Becomes correct when: The organization is an eligible existing customer and the exact supported device behavior and logistics satisfy the workload.It can supply local AWS infrastructure, but the small device-oriented path does not justify installation, capacity, and facility operations.
Becomes correct when: A larger portfolio needs compatible AWS services on premises and its local capacity and operational commitment are justified.Device-local components do not replace the Regional memory fleet, queued batch scheduler, or distributed Spark framework.
Becomes correct when: Those tasks are reduced to bounded local device components within measured device resources.INTERACTIVE ARCHITECTURE VISUAL
Match compute to the measured work
Choose a work shape and placement requirement, then test a compute candidate.
× Work shape missedThe candidate misses the workload model or placement boundary.
Read the diagram as text
Five-lane worksheet: online API, queued job, distributed framework, viewer-edge function, and disconnected device loop. Record bottleneck, placement, WAN dependence, security, measured result, and total operations cost.
KNOWLEDGE CHECK
Answer one question at a time
Pass every question to complete this lesson. Each answer includes reasoning before you continue.
KEY TERMS
Glossary
- Resource envelope
- The measured CPU, memory, storage, network, accelerator, duration, and concurrency needs of work.
- Instance family
- An EC2 hardware profile emphasising resources such as compute, memory, storage, or acceleration.
- Tail latency
- Slow-end response time, often measured at p95 or p99 rather than an average.
- AWS Batch
- A managed scheduler for finite queued jobs and their compute environments.
- Amazon EMR
- Managed distributed data processing for frameworks such as Spark and Hadoop.
- Lambda@Edge
- Code invoked at supported CloudFront events near viewers.
- AWS Outposts
- AWS-managed infrastructure installed on premises for compatible local workloads.
- AWS IoT Greengrass
- Software for deploying and running components on edge devices, including intermittent-connectivity operation.
- Operation identifier
- A stable ID used to reconcile retried offline work without duplicating its business effect.
- Completed-work cost
- Cost evaluated against successfully completed work at the required performance target.
PRIMARY SOURCES
Verify the claims
- primaryAmazon EC2 instance typesaws-ec2-instance-types · retrieved 2026-07-30
- primaryPlacement groups for your Amazon EC2 instancesaws-ec2-placement-groups · retrieved 2026-07-30
- primaryConfigure Lambda function memoryaws-lambda-memory-configuration · retrieved 2026-07-30
- primaryLambda quotasaws-lambda-quotas · retrieved 2026-07-30
- primaryWhat is AWS Batch?aws-batch-overview · retrieved 2026-07-30
- primaryWhat is Amazon EMR?aws-emr-overview · retrieved 2026-07-30
- primaryArchitect for AWS Fargate for Amazon ECSaws-ecs-fargate-architecture · retrieved 2026-07-30
- primaryWhat is Amazon EC2?aws-compute-ec2 · retrieved 2026-07-29
- primaryLambda Edgeaws-lambda-edge · retrieved 2026-07-30
- primarySnowball Edge Currentaws-snowball-edge-current · retrieved 2026-07-30
- primaryWhat is AWS Outposts?aws-outposts-overview · retrieved 2026-07-30
- primaryWhat is AWS IoT Greengrass?aws-greengrass-overview · retrieved 2026-07-30
- primaryAuthenticating clients while offlineaws-greengrass-offline-authentication · retrieved 2026-07-30