AWS wellarchitected: Rewrite ADVPERF01-BP03 latency guidance; add VPC endpoint steps
Summary
Restructures the Video Streaming Advertising Lens performance best practice ADVPERF01-BP03 into desired outcome, anti-patterns, benefits, risk level, and numbered implementation steps. Adds concrete guidance on compute benchmarking, SSD/EBS and instance store selection, ElastiCache in-memory caching, enhanced networking (SR-IOV/ENA), and creating VPC interface endpoints so S3, DynamoDB, and ElastiCache traffic stays on the AWS private network instead of traversing the internet gateway.
Security assessment
The page is a latency/performance best practice, not a security advisory; no vulnerability, CVE, or incident is referenced. The only security-adjacent content is the recommendation to use VPC interface endpoints (AWS PrivateLink) so service calls bypass the internet gateway, plus a verification step using VPC Flow Logs. This is a private-connectivity hardening side effect of a performance recommendation rather than documentation of a security feature, so it is treated as tangential.
Evidence
5. **Create VPC endpoints for AWS services on the critical path:** Configure VPC interface endpoints for the AWS services your workloads call most frequently on the bid path (S3, DynamoDB, and ElastiCache). This routes traffic for those services directly from your VPC to the service endpoint over the AWS private network, bypassing the internet gateway. Verify that DNS resolution returns private endpoint addresses after configuration by checking that service calls no longer appear in VPC Flow Logs as traffic traversing the internet gateway.
Diff
diff --git a/wellarchitected/latest/video-streaming-advertising-lens/advperf01-bp03.md b/wellarchitected/latest/video-streaming-advertising-lens/advperf01-bp03.md index 7997168..3ffe5de 100644 --- a//wellarchitected/latest/video-streaming-advertising-lens/advperf01-bp03.md +++ b//wellarchitected/latest/video-streaming-advertising-lens/advperf01-bp03.md @@ -11 +11 @@ Implementation guidanceResources -Use features from AWS compute, storage, and network services that cater to low latency advertising workload needs. +Use purpose-built AWS compute, storage, and network features to minimize latency at every layer of your advertising stack. When you match each infrastructure component to the demands of ad serving and bidding workloads, you get the consistent single-digit-millisecond response times that programmatic advertising requires. @@ -13 +13,14 @@ Use features from AWS compute, storage, and network services that cater to low l -## Implementation guidance +**Desired outcome:** + + * Every layer of your infrastructure (compute, storage, and networking) is configured to minimize latency for ad serving and bidding workloads. + + * Instance selection, storage type, caching, and network configuration are chosen with performance benchmarks in mind, not defaults. + + * Frequently accessed bid data (user profiles, frequency caps, audience segments) is served from in-memory caches rather than network-attached databases. + + * All AWS service calls from your VPC travel over private endpoints, removing public internet hops from the data path. + + + + +**Common anti-patterns:** @@ -15 +28 @@ Use features from AWS compute, storage, and network services that cater to low l -Consider the following guidance for compute, storage, and network: + * Using general-purpose instances without benchmarking against workload-specific parameters (CPU performance, memory bandwidth, launch time). @@ -17 +30 @@ Consider the following guidance for compute, storage, and network: -**Compute** + * Relying on network-attached storage or remote service calls for latency-sensitive data access paths where instance-attached SSD or in-memory caching would be much faster. @@ -19 +32 @@ Consider the following guidance for compute, storage, and network: - * Use [compute-optimized](https://aws.amazon.com/ec2/instance-types/) instances. Use benchmarking based on parameters like CPU, memory, launch time, and burst performance to choose the appropriate instance type. + * Accessing AWS services (S3, DynamoDB, and ElastiCache) over public endpoints from within a VPC, which routes traffic through the internet gateway and introduces latency variability. @@ -21 +34 @@ Consider the following guidance for compute, storage, and network: - * Cluster your [EC2 instances](https://aws.amazon.com/ec2/) into [placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) for ad serving components for the lowest possible latency between instances. + * Placing EC2 instances across Availability Zones without a placement group, when a cluster placement group would give tighter inter-instance latency. @@ -26 +39 @@ Consider the following guidance for compute, storage, and network: -**Storage** +**Benefits of establishing this best practice:** @@ -28 +41,12 @@ Consider the following guidance for compute, storage, and network: - * Implement instance-attached SSD [Amazon EBS](https://aws.amazon.com/ebs/) volumes for lowest latency storage. + * Matching each infrastructure layer to the specific demands of advertising workloads reduces bid response times and improves throughput under high request volumes. + + * Purpose-built configurations reduce wasted compute spend by right-sizing resources to actual workload characteristics rather than paying for general-purpose overhead. + + * Private connectivity and in-memory caching remove two of the most common sources of latency variability in production advertising systems. + + + + +**Level of risk exposed if this best practice is not established:** High + +## Implementation guidance @@ -30 +54 @@ Consider the following guidance for compute, storage, and network: - * Implement provisioned IOPS SSDs if you have an IOPS-intensive workload. +A bid response that arrives a few milliseconds late misses the auction window entirely. The cost of latency is immediate and measurable in dollars, so infrastructure design for advertising workloads differs from general enterprise applications. @@ -32 +56 @@ Consider the following guidance for compute, storage, and network: - * Implement [Amazon EFS](https://aws.amazon.com/efs/) for shared file storage with burst capability. +On a bid path, most of the budget is spent waiting rather than computing, on a data lookup, a network hop, or a queue. Compute selection matters, but it optimizes only the smaller share. A faster processor can't recover a round trip that should never have been on the critical path. Measure the split between waiting and working on each request and tune the higher measurement. @@ -34 +58 @@ Consider the following guidance for compute, storage, and network: - * Implement [Elasticache Redis](https://aws.amazon.com/elasticache/) or Memcached to cache frequently accessed data. +Tail behavior deserves more weight than the average, because the deadline is a hard cutoff. A path with a good median and an erratic tail loses the auctions at the tail. Those tail requests count the same as a total outage. Jitter is a first-class concern, and reducing variance at an unchanged median is a gain. Lowering the median at the cost of a longer tail can be a net loss. Shared and burstable resources vary by design, so use them cautiously on latency-critical paths. @@ -35,0 +60 @@ Consider the following guidance for compute, storage, and network: +Storage placement is the most frequent decision on the path, which concerns access patterns. Data consulted on every request must be reachable without a network round trip. At auction volume that round trip has the highest cost regardless of the store's speed. Data consulted occasionally can be stored anywhere. The trade-off is that the fastest options are the least durable, so anything in local or volatile storage must be reconstructible or replicated. @@ -36,0 +62 @@ Consider the following guidance for compute, storage, and network: +Pursue physical proximity between components only where they communicate constantly, since it trades against failure isolation. Co-locating instances reduces the latency between them but concentrates their exposure to a single failure. For each tier, decide whether to co-locate only a latency-critical tier, and spread the rest across failure boundaries. @@ -37,0 +64 @@ Consider the following guidance for compute, storage, and network: +Per-packet efficiency depends on the instance and its driver, so address it when you provision. Path selection is a property of the topology. A service call that leaves the private network and returns adds an unnecessary hop that no instance tuning fixes. The hop is easy to miss because the traffic works either way. @@ -39 +66 @@ Consider the following guidance for compute, storage, and network: -**Networking** +### Implementation steps @@ -41 +68 @@ Consider the following guidance for compute, storage, and network: - * Implement enhanced networking for higher I/O and packet per second performance. + 1. **Select compute-optimized instances based on benchmarking:** Benchmark candidate instance types against your specific workload parameters (CPU clock speed, memory bandwidth, instance startup time, and burst performance) before selecting. For ad serving components where inter-instance communication is latency-sensitive, place EC2 instances in a cluster placement group to deliver the lowest possible network latency between them. @@ -43 +70,7 @@ Consider the following guidance for compute, storage, and network: - * Implement [VPC endpoints](https://aws.amazon.com/vpc/) to access AWS services within the network. + 2. **Attach SSD-backed EBS volumes for your lowest-latency storage needs:** Use GP3 volumes as the default for application servers and decision engines. Use Provisioned IOPS SSD (io1/io2) volumes for databases that power bid management systems and ad servers where I/O variability directly affects response times. Use EC2 Instance Store (NVMe-backed) when you need the highest possible storage throughput for real-time database workloads like Aerospike. Instance Store data doesn't persist beyond the instance lifecycle. + + 3. **Deploy[ Amazon ElastiCache](https://aws.amazon.com/elasticache/) to serve frequently accessed data from memory:** Use ElastiCache for Redis or Memcached to cache high-read data such as user segments, frequency caps, and targeting metadata. Serving this data from memory avoids repeated database lookups on the critical bid path, directly reducing response latency. Colocate ElastiCache nodes in the same Availability Zone as your bidding compute to avoid cross-AZ network hops from cache reads. + + 4. **Enable enhanced networking on EC2 instances:** Enhanced networking uses single-root I/O virtualization (SR-IOV) to deliver higher packet-per-second performance, lower inter-instance latency, and reduced jitter, all critical for high-throughput ad serving under load. Verify that your AMI and instance type support enhanced networking and that the ENA or ixgbevf driver is enabled. + + 5. **Create VPC endpoints for AWS services on the critical path:** Configure VPC interface endpoints for the AWS services your workloads call most frequently on the bid path (S3, DynamoDB, and ElastiCache). This routes traffic for those services directly from your VPC to the service endpoint over the AWS private network, bypassing the internet gateway. Verify that DNS resolution returns private endpoint addresses after configuration by checking that service calls no longer appear in VPC Flow Logs as traffic traversing the internet gateway. @@ -50 +83,21 @@ Consider the following guidance for compute, storage, and network: - * [Leveraging Amazon EKS managed node group with placement group for low latency critical applications](https://aws.amazon.com/blogs/containers/leveraging-amazon-eks-managed-node-group-with-placement-group-for-low-latency-critical-applications) +**Related best practices:** + + * [ADVPERF02-BP04 Use a specialized instance family and features](./advperf02-bp04.html) + + * [ADVPERF05-BP01 Establish private connections between your VPC and AWS services to improve performance](./advperf05-bp01.html) + + + + +**Related documents:** + + * [Enhanced Networking on Linux](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html) + + * [Leverage Amazon EKS managed node group with placement group for low latency critical applications](https://aws.amazon.com/blogs/containers/leveraging-amazon-eks-managed-node-group-with-placement-group-for-low-latency-critical-applications/) + + + + +**Related services:** + + * [Amazon ElastiCache](https://aws.amazon.com/elasticache/) @@ -52 +105 @@ Consider the following guidance for compute, storage, and network: - * [New Amazon EC2 Instances (C7gd, M7gd, and R7gd) Powered by AWS Graviton3 Processor with Local NVMe-based SSD Storage](https://aws.amazon.com/blogs/aws/new-amazon-ec2-instances-c7gd-m7gd-and-r7gd-powered-by-aws-graviton3-processor-with-local-nvme-based-ssd-storage/) + * [Amazon EBS](https://aws.amazon.com/ebs/) @@ -54 +107 @@ Consider the following guidance for compute, storage, and network: - * [Enhanced Networking](https://docs.aws.amazon.com/pdfs/AWSEC2/latest/UserGuide/ec2-ug.pdf#enhanced-networking) + * [AWS PrivateLink](https://aws.amazon.com/privatelink/) @@ -67 +120 @@ ADVPERF01-BP02 Use appropriate scaling to handle burst traffic with cost conside -ADVPERF01-BP04 Evaluate AI/ML-based architecture for optimization (like contextual advertising or scaling algorithms on event context) +ADVPERF01-BP04 Evaluate AI/ML-based architecture for optimization