2. Maximize performance and savings
with AWS Compute Optimizer
Pat Davies
Platform Engineer at Direct Supply
www.linkedin.com/in/patrickdaviesds
3. About me and Direct Supply
● I joined Direct Supply in 2010 - Platform Engineer since 2018
● Direct Supply provides products and solutions for the senior care
market:
○ DSSI: Procurement, spend management, and contract compliance
○ TELS: Building management and building services
○ Aptura: Design, construction and renovation
○ Health & Wellness: products and technology systems for safe,
effective, and efficient care
pdavies@directs.com
www.linkedin.com/in/patrickdaviesds
5. But first, don’t forget about…
● Discounts - reservations, savings plans, EDPs, etc.
○ No engineering effort
○ No architecture conversations required
● Deleting unused resources - EBS volumes, static IPs, etc.
● Suspending - Turn off workloads that are not in use
6. What is rightsizing?
<@your social handle>
Configuring or re-configuring your resources to maximize
savings while meeting your performance requirements
● Downsize resources without compromising performance
● Increase or modify resources to meet performance goals
● Maximize the value from your spend
● Resource optimization is cost and performance
7. Challenges of rightsizing
● Data collection and analysis takes engineering effort
● Understanding which AWS resources are available and
appropriate to make an improvement in your environment
can be time-consuming and error-prone
…wouldn’t it be nice if there were something to help?
8. AWS Compute Optimizer
Launched in 2019, AWS CO is a machine learning AWS service
that uses your existing CloudWatch metrics to identify
overprovisioned and underprovisioned EC2, EBS volume,
Network, Lambda functions, and ECS Fargate resources. AWS
CO makes recommendations on how to optimize those
resources.
9. Where is it?
● It has its own dashboard
● Integrated with AWS Cost Explorer, under
“Rightsizing recommendations”
● AWS CO recommendations are in the details of the
EC2 instance:
10. Viewing & Accessing Recommendations
In AWS CO, you can view a list of resources by type (here filtered by a tag)
11. Viewing & Accessing Recommendations
Drill down to find recommendation options, comparisons, and metrics
12. Viewing & Accessing Recommendations
In the AWS CO console, you can export utilization data and
recommendations to a CSV file in an S3 bucket
● Export information for one or more regions
● Filter by resource types: EC2, ASG, EBS, Network, or ECS
● Select columns to include:
○ Information about the resource (name, vCPUs, memory, etc.)
○ Utilization metrics
○ Recommendations
○ Migration effort and risks
14. Mine the CSV file with Excel:
Clean it up: hide unwanted columns, add flavor to taste
15. A real example use case
We suspected that Windows instances with 2 vCPUs and/or
2GB of memory were a bottleneck during our patching process.
We wanted to identify these instances and determine the cost to
migrate these to instances with at least 4 vCPUs and 4GB of
memory.
16. Use case, cont.
Use ARRAYFORMULA lookup to determine the next size in the
EC2 class that gets us at least 4GB of memory and 2 vCPUs
18. AWS Compute Optimizer for Lambda Functions
● Identifies which are CPU intensive vs. memory intensive
● A Lambda function that uses minimal CPU with over-provisioned memory
should be adjusted. Reducing the memory saves costs and won’t
adversely affect performance.
● A CPU-intensive Lambda function can have a recommendation to
increase memory - more memory increases cost, but the runtime will be
shorter. This can result in paying about the same amount of money while
improving the performance of your Lambda function.
19. AWS Compute Optimizer EC2 Components
● CPU
● Memory (with monitoring enabled)
● Network performance (bytes/packets in/out per second, etc.)
● Storage (throughput and IOPS for local SSD and attached EBS)
● Auto-scaling groups
20. AWS Compute Optimizer “Tips”
● Must be enabled in the console
● Using the last 14 days of metrics is free - expanding to 3 months
of data incurs a cost
● Memory metric is not available by default
○ CloudWatch agent
○ Other sources such as Datadog, Dynatrace, Instana, and New Relic
● Implement tagging standards - understand what you are
optimizing and who needs to be involved in the discussion
● Recommendations are refreshed daily
21. AWS Compute Optimizer “Tips”
● Analysis takes into account the fact that you may be very CPU
intensive during the day and idle at night (it doesn’t just take the
average…)
● AWS CO actively developed; find the latest features here:
https://docs.aws.amazon.com/compute-optimizer/latest/ug/doc-history.html?icmpid=docs_co_help_panel