

# PERF08-BP01 Understand the areas where performance is most critical
<a name="perf_tradeoffs_performance_critical_areas"></a>

 Understand and identify areas where increasing the performance of your workload will have a positive impact on efficiency or customer experience. For example, a website that has a large amount of customer interaction can benefit from using edge services to move content delivery closer to customers. 

**Desired outcome:** Increase performance efficiency by understanding your architecture, traffic patterns, and data access patterns, and identify your latency and processing times. Identify the potential bottlenecks that might affect the customer experience as the workload grows. When you identify those areas, look at which solution you could deploy to remove those performance concerns.

 **Common anti-patterns:** 
+  You assume that standard compute metrics such as `CPUUtilization` or memory pressure are enough to catch performance issues. 
+  You only use the default metrics recorded by your selected monitoring software. 
+  You only review metrics when there is an issue. 

 **Benefits of establishing this best practice:** Understanding critical areas of performance helps workload owners monitor KPIs and prioritize high-impact improvements. 

 **Level of risk exposed if this best practice is not established:** High 

## Implementation guidance
<a name="implementation-guidance"></a>

Set up end-to-end tracing to identify traffic patterns, latency, and critical performance areas. Monitor your data access patterns for slow queries or poorly fragmented and partitioned data. Identify the constrained areas of the workload using load testing or monitoring.

## Implementation steps
<a name="w2aac19c13c13b5b6c17"></a>

1.  Set up end-to-end monitoring to capture all workload components and metrics. 
   +  Use [Amazon CloudWatch Real-User Monitoring (RUM)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM.html) to capture application performance metrics from real user client-side and frontend sessions. 
   +  Set up [AWS X-Ray](https://aws.amazon.com/xray/) to trace traffic through the application layers and identify latency between components and dependencies. Use the X-Ray service maps to see relationships and latency between workload components. 
   +  Use [Amazon Relational Database Service Performance Insights](https://aws.amazon.com/rds/performance-insights/) to view database performance metrics and identify performance improvements. 
   +  Use [Amazon RDS Enhanced Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html) to view database OS performance metrics. 
   +  Collect [CloudWatch metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html) per workload component and service and identify which metrics impact performance efficiency. 
   +  Set up [Amazon DevOps Guru](https://aws.amazon.com/devops-guru/) for additional performance insights and recommendations 

1.  Perform tests to generate metrics, identify traffic patterns, bottlenecks, and critical performance areas. 
   +  Set up [CloudWatch Synthetic Canaries](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html) to mimic browser-based user activities programmatically using `cron` jobs or rate expressions to generate consistent metrics over time. 
   +  Use the [AWS Distributed Load Testing](https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws/) solution to generate peak traffic or test the workload at the expected growth rate. 

1.  Evaluate the metrics and telemetry to identify your critical performance areas. Review these areas with your team to discuss monitoring and solutions to avoid bottlenecks. 

1.  Experiment with performance improvements and measure those changes with data. 
   +  Use [CloudWatch Evidently](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently.html) to test new improvements and the performance impact to the workload. 

 **Level of effort for the implementation plan:** To establish this best practice, you must review your end-to-end metrics and be aware of your current workload performance. This is a moderate level of effort to set up end to end monitoring and identify your critical performance areas. 

## Resources
<a name="resources"></a>

 **Related documents:** 
+  [Amazon Builders’ Library](https://aws.amazon.com/builders-library) 
+  [X-Ray Documentation](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html) 
+  [Amazon CloudWatch RUM](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM.html) 
+  [Amazon DevOps Guru](https://aws.amazon.com/devops-guru/) 
+  [CloudWatch RUM and X-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-services-RUM.html) 

 **Related videos:** 
+  [Introducing The Amazon Builders’ Library (DOP328)](https://www.youtube.com/watch?v=sKRdemSirDM) 
+  [Demo of Amazon CloudWatch Synthetics](https://www.youtube.com/watch?v=hF3NM9j-u7I) 

 **Related examples:** 
+  [Measure page load time with Amazon CloudWatch Synthetics](https://github.com/aws-samples/amazon-cloudwatch-synthetics-page-performance) 
+  [Amazon CloudWatch RUM Web Client](https://github.com/aws-observability/aws-rum-web) 
+  [X-Ray SDK for Node.js](https://github.com/aws/aws-xray-sdk-node) 
+  [X-Ray SDK for Python](https://github.com/aws/aws-xray-sdk-python) 
+  [X-Ray SDK for Java](https://github.com/aws/aws-xray-sdk-java) 
+  [X-Ray SDK for .Net](https://github.com/aws/aws-xray-sdk-dotnet) 
+  [X-Ray SDK for Ruby](https://github.com/aws/aws-xray-sdk-ruby) 
+  [X-Ray Daemon](https://github.com/aws/aws-xray-daemon) 
+  [Distributed Load Testing on AWS](https://aws.amazon.com/solutions/implementations/distributed-load-testing-on-aws/) 