Finding and Removing Performance Bottlenecks
This lesson explains how to find and remove the performance bottlenecks that appear as traffic, data and access patterns change, and which change gives the best improvement with the least effort or risk.
Learning outcomes
After completing this lesson, you will be able to:
- Diagnose bottlenecks from symptoms with the right tool.
- Describe how observability reveals bottlenecks.
- Explain why performance is improved one change at a time.
Finding performance bottlenecks
Performance problems are diagnosed from evidence, not from intuition. Each symptom points to a specific tool that confirms the cause: CloudWatch Database Insights, which replaced the Performance Insights console in mid-2026, shows which SQL statements load a database, CloudWatch RUM and Internet Monitor show whether distant users suffer from network latency, the CloudFront cache hit ratio shows whether the cache is working, Contributor Insights shows hot DynamoDB keys, and the Init Duration in Lambda logs shows the cost of cold starts.
Once the cause is confirmed, the improvement is usually a well-known pattern: a replica or cache for read load, an edge service for distance, a better key for hot partitions. The exam's preferred answer is the one that addresses the confirmed cause with the least effort and risk. The following table pairs common symptoms with their evidence and remedies.
| Symptom | Evidence | Typical improvement |
|---|---|---|
| Database CPU high on reads | Database Insights top SQL; read/write ratio | Read replicas, ElastiCache, query and index tuning |
| Latency for distant users | CloudWatch RUM, Internet Monitor | CloudFront, Global Accelerator, additional Region |
| Slow page loads from static assets | CloudFront cache hit ratio, origin load | Cache policies, Origin Shield, versioned assets |
| Throttling on DynamoDB | Contributor Insights hot keys | Key design, on-demand mode, DAX for reads |
| Lambda latency spikes | Init duration in logs, X-Ray | SnapStart, provisioned concurrency, smaller packages |
| EBS-bound instances | VolumeQueueLength, burst balance | gp3 with provisioned IOPS, io2, instance store |
Finding bottlenecks
Observability that reveals bottlenecks
A bottleneck can be fixed only once it is found, and each tool reveals a different kind. AWS X-Ray and CloudWatch Application Signals show which service or downstream call in a request path contributes the most latency. CloudWatch RUM and Synthetics measure what users actually experience, which may differ from what server metrics suggest.
Compute Optimizer flags under-provisioned resources as well as over-provisioned ones, so it finds instances that are too small as readily as those that waste money. Percentile metrics, such as p99 latency, reveal the tail latency that averages hide, which is often where users notice slowness first.
Improving safely
Performance work follows the evidence: measure, change one thing, and measure again, so that each improvement is proven rather than assumed and an unhelpful change can be reverted. Changing several things at once hides which one helped and which one hurt.
Load tests against a production-like environment confirm that a change helps at the expected scale, because some improvements, such as a cache, behave differently under real traffic. A canary release then limits the impact if a change that looked good in testing harms production.
A slow product catalogue
A retailer's product pages have become slow as the catalogue has grown. CloudWatch RUM shows a p95 page load time of four seconds for users in Asia; Database Insights shows the Aurora writer at 85% CPU, dominated by catalogue read queries; and the CloudFront cache hit ratio is 40% because the cache policy forwards all cookies. The architect changes the cache policy to forward only the cookies that alter the page, which raises the hit ratio above 90%; adds an Aurora replica with Auto Scaling and points catalogue reads at the reader endpoint; and adds ElastiCache for the product detail queries. Page load time falls below one second, and the writer's CPU drops to 30%.
Which evidence should guide a performance improvement?
Show answer
Measurements: CloudWatch metrics, X-Ray traces, Database Insights for databases and Compute Optimizer recommendations show where time is actually spent.
Exam Tips
Remember for the exam
- For database read bottlenecks, add read replicas or a cache; find the cause with CloudWatch Database Insights.
- Use CloudWatch RUM to measure the latency real users experience.
- Forward only necessary headers and cookies in CloudFront cache policies to raise the hit ratio.
- Throttling with unused total capacity in DynamoDB indicates a hot key.
- Change one thing at a time and measure the effect.