Solutions Architect

Compute performance

Designing high-performing and elastic compute is task 3.2 of Design High-Performing Architectures, 24% of the scored content: the right instance, the right placement and scaling on the right metric.

Instance types

Amazon EC2 instance types

Official page

The instance type fixes the CPU, memory, storage and network of the host. Pick the category first, then the size.

Key points

  • Naming: in c7gn.xlarge, c is the series, 7 the generation, gn the options (Graviton, network and EBS optimized) and xlarge the size. Other options: a AMD, i Intel, d instance store volumes, z high CPU frequency.
  • Burstable (T series): a CPU baseline plus credits to burst. Good for low average CPU with spikes, such as small web servers and development environments.
  • Flex (such as M7i-flex and C7i-flex): 40% baseline CPU that can reach 100% for 95% of the time over 24 hours. The most cost-effective choice for general workloads that do not need full CPU all the time.
  • Rightsizing: AWS Compute Optimizer analyzes 14 days of CloudWatch metrics and recommends instance types for EC2 instances and Auto Scaling groups.
  • Fixed performance families (M, C, R and others) sustain full CPU at any time, the right choice for video encoding, high volume websites and HPC.

On the exam

"In-memory database or real-time analytics" -> memory optimized (R, X). "Batch processing, transcoding, game servers" -> compute optimized (C). "High random I/O on large local datasets" -> storage optimized (I, D).

Instance categories

CategorySeries and use cases
General purposeM, T, Mac. Balanced compute, memory and network: web servers, code repositories, small databases.
Compute optimizedC. Fast processors: batch processing, media transcoding, dedicated game servers.
Memory optimizedR, X, U, z. Large datasets in memory: in-memory databases, data analytics, enterprise apps.
Storage optimizedI, D, H. Low latency random I/O and high sequential throughput on local storage.
Accelerated computingP, G, Inf, Trn, F. GPUs, AWS Inferentia, AWS Trainium and FPGAs for ML and graphics.
HPC optimizedHpc. Large-scale simulations, deep learning and rendering.
Official page

Placement groups decide how instances sit on the underlying hardware, trading network performance against isolation from correlated failures.

Key points

  • Cluster: instances packed in one high-bisection bandwidth segment of a single AZ. Up to 10 Gbps per flow inside the group (5 Gbps outside). Launch all instances in one request with one instance type to avoid capacity errors.
  • Partition: up to 7 partitions per AZ, each on its own racks with separate network and power. The number of instances is limited only by account limits, and topology-aware apps such as HDFS, HBase and Cassandra can see the partition.
  • Spread: each instance on distinct racks, at most 7 running instances per AZ per group. The group can span AZs. For a few critical instances.
  • Capacity: an On-Demand Capacity Reservation can target a cluster placement group. Capacity Reservations do not reserve capacity in partition or spread groups.

On the exam

"HPC nodes exchange data constantly" -> cluster (with EFA or enhanced networking). "Cassandra or HDFS rack awareness" -> partition. "A handful of critical instances must not fail together" -> spread.

Placement strategies

StrategyLayout and limits
ClusterOne AZ, one high-bandwidth network segment. Lowest latency, highest throughput. Can span peered VPCs.
PartitionGroups of racks, up to 7 partitions per AZ, can span AZs. Large distributed and replicated workloads.
SpreadOne instance per rack, up to 7 running instances per AZ, can span AZs. Small critical sets.

Enhanced networking

ENA and Elastic Fabric Adapter

Official page

Network performance depends on the instance type and on the network device. Both options below have no additional charge.

Key points

  • ENA (Elastic Network Adapter): enhanced networking with SR-IOV for higher bandwidth, higher packets per second and consistently lower latency. All Nitro-based instances use it, with up to 100 Gbps.
  • EFA (Elastic Fabric Adapter): adds OS-bypass through Libfabric and the SRD protocol for MPI (HPC) and NCCL (machine learning) traffic, with lower and more consistent latency than TCP.
  • EFA limits: EFA traffic cannot cross AZs or VPCs and is not routable. Only supported instance types, and not on AWS Outposts.
  • Instance choice: the n option means network and EBS optimized. Between two instances, the slower one caps the throughput.

On the exam

"Tightly coupled HPC or distributed ML training with MPI or NCCL" -> EFA inside a cluster placement group. "More PPS and lower latency for a regular application tier" -> ENA enhanced networking, not EFA.

Scaling metrics

Amazon EC2 Auto Scaling

Official page

Auto Scaling moves the desired capacity between the minimum and the maximum. The policy and the metric decide how fast and how precisely it follows load.

Key points

  • Target tracking (recommended): keeps a metric at a target, like a thermostat. Predefined metrics are ASGAverageCPUUtilization, ASGAverageNetworkIn, ASGAverageNetworkOut and ALBRequestCountPerTarget.
  • Right metric: it must change in inverse proportion to capacity. Raw RequestCount, latency and the SQS ApproximateNumberOfMessagesVisible do not work. For queues, use backlog per instance.
  • Step and simple scaling: CloudWatch alarm thresholds with adjustments sized by the breach, or a single adjustment followed by a cooldown.
  • Predictive and scheduled: predictive scaling uses up to 14 days of history (24 hours minimum) to forecast 48 hours and launch capacity before daily or weekly peaks. Scheduled actions change capacity at set times, once or on a cron.
  • Reaction time: enable EC2 detailed monitoring (1-minute metrics instead of 5) and set an instance warmup so new instances do not distort the average.
  • AWS Auto Scaling: one place to build scaling plans for EC2 Auto Scaling groups, Spot Fleets, ECS tasks, DynamoDB tables and indexes, and Aurora Replicas.

On the exam

"Workers consuming an SQS queue fall behind" -> target tracking on backlog per instance. "Load jumps every weekday at 9 AM and instances boot slowly" -> predictive or scheduled scaling. "Keep CPU around 50%" -> target tracking.

Hibernation

EC2 instance hibernation

Official page

Hibernation writes RAM to the EBS root volume and resumes the same processes on start, skipping a long boot or cache warm-up.

Key points

  • Prerequisites: enabled at launch only, on an encrypted EBS root volume large enough for the RAM, with a supported AMI and family. RAM under 150 GiB on Linux and up to 16 GiB on Windows.
  • After resume: same instance ID, private IPs and Elastic IPs. A new public IPv4 address is assigned and instance store data is lost.
  • Limits: no changes while hibernated, at most 60 days hibernated, and no hibernation for instances in an Auto Scaling group or used by ECS.
  • Billing: no instance usage charge while stopped. You pay for the EBS volumes, including the saved RAM, and associated Elastic IPs.

On the exam

"Application takes too long to rebuild its in-memory state after a restart" -> hibernate instead of stop. If the instance belongs to an Auto Scaling group, hibernation is not an option.

Batch and EMR

AWS Batch and Amazon EMR

Official page

Managed engines for workloads made of jobs, not servers: AWS Batch for containerized batch jobs, Amazon EMR for big data frameworks.

Key points

  • AWS Batch: queues containerized jobs and provisions the compute they need on ECS, EKS, Fargate and On-Demand or Spot instances, scaling with the queue. No additional charge beyond the resources used.
  • Batch fit: ML training, simulations, genomics, rendering, transcoding and financial analytics, including jobs longer than the 15 minutes Lambda allows.
  • Amazon EMR: managed Apache Spark, Hive, Trino, Flink and other frameworks, on EC2 clusters, on EKS or as EMR Serverless.
  • EMR nodes: primary (coordinates), core (runs tasks and stores HDFS) and optional task nodes (run tasks only). Task nodes hold no HDFS data, which makes them the natural place for Spot Instances.
  • Transient clusters: keep input and output in S3 and let the cluster terminate after its last step.

On the exam

"Thousands of containerized jobs, no scheduler to run" -> AWS Batch. "Petabyte-scale Spark or Hive processing" -> Amazon EMR (EMR Serverless to skip cluster management). A job over 15 minutes rules out Lambda.

Compute near users

Outposts, Local Zones and Wavelength

Official page

When milliseconds or data location matter, AWS infrastructure runs outside the Region while the parent Region keeps the same APIs and tools.

Key points

  • AWS Outposts: AWS-managed 42U racks (up to 96) or 1U and 2U servers in your own facility. For single-digit millisecond latency to on-premises systems, local data processing and migrations with local dependencies.
  • Local Zones: AWS compute, storage, database and networking in large metro areas, extending a Region. For real-time gaming, live streaming, AR/VR and virtual workstations close to users.
  • Wavelength: AWS compute and storage at the edge of telecom carrier networks, reached through a carrier gateway. For low latency to mobile devices on 5G.
  • VPC extension: a VPC spans Availability Zones, Local Zones and Wavelength Zones through subnets created in each zone.
  • Data residency: all three keep data inside a chosen country, state or site to meet regulatory requirements.

On the exam

"Low latency to systems that must stay in our data center" -> Outposts. "Low latency for users in a city far from any Region" -> Local Zones. "Mobile app on a 5G carrier network" -> Wavelength.

Elastic Beanstalk

AWS Elastic Beanstalk

Official page

Upload the code and Elastic Beanstalk provisions the environment, load balancing, health monitoring and scaling. No additional charge beyond the resources.

Key points

  • Platforms: Go, Java, .NET, Node.js, PHP, Python, Ruby and Docker containers.
  • Modes: Standard runs directly on EC2 and supports Windows. Cluster runs on Amazon EKS for faster deployments and autoscaling.
  • Worker environment: a managed SQS queue plus a daemon that POSTs each message to the application. Offloads long tasks from the web tier and runs periodic jobs from cron.yaml.
  • Control: the resources are created in your account, so you keep access to the instances and their configuration.

On the exam

"Developers want to deploy a web app fast without managing infrastructure" -> Elastic Beanstalk. "Long background tasks slow the web tier" -> a worker environment with SQS.