Use AWS Cost Explorer

The first thing to do is to identify what costs you the most. Use AWS Cost Explorer to view and analyze your AWS costs and usage. This tool provides default reports that help you visualize cost and usage at a high level (e.g. AWS accounts, AWS service), or at the resource level (e.g. EC2 instance ID). Start by identifying the top accounts where your costs incur using the “Monthly costs by linked account report”. Next, identify the top services that contribute to the costs within those accounts. You can do this by using the “Monthly costs by service report”. Use the hourly and resource level granularity and tags to filter and identify the top resources incurring costs.

Reduce Transfer costs

As explained in a previous article, AWS data transfer costs are what AWS charges to transfer data either:

  • Between AWS and the internet
  • Within AWS between services, such as EC2 or S3

It represent 30% of total costs.

Here are the actions you should take to reduce transfer costs :

  • Choose regions wisely (fees depends on region)
  • Operate in and out of private IP instead of public IP (cheaper)
  • Enable caching (CloudFront) at your origin servers to accelerate delivery of our websites.

Shutdown unused instances

An easy way to optimize costs is to shutdown unused intances. Especially in development environments at the end of each working day and weekends. Indeed services like Elastic Beanstalk allow developers to quickly deploy and redeploy applications with consistency, without worrying about the configuration of the underlying infrastructure. Finally, don’t stop, but terminate instances which are unused whenever is possible ! If you only stop it, you will keep the EBS costs running !

Resize low utilization instances

There are severaly way to tackle this problem

The way to check the instance historical data is super simple, and on your AWS Panel, you need to go to Services, EC2, Instances, Running Instances, select instance, monitoring. An example of metrics that you can check is CPU Utilization.

Moreover you can use AWS Instance Scheduler to automatically stop instances. Finally use AWS Operations Conductor to automatically resize the EC2 instances (based on the recommendations report from Cost Explorer) :

Delete orphaned snapshots

As explained previously, you will have to pay storage for VM down and snaphosts. You can automate the creation /deletion of snapshots using the Amazon Data Lifecycle Manager. Follow the steps here to delete EBS volumes.

Select the appropriate S3 storage class

The are 5 tiers of Amazon S3 object storage available, and it’s important to select the correct class to optimize your costs.

  • Amazon S3 Standard is for general purpose usage for frequently accessed data, and is used for a variety of use cases.
  • Amazon S3 Standard-Infrequent Access (IA) is for data that is used less frequently, requires the same resiliency as the standard storage class, but can be retrieved rapidly when needed.
  • Amazon S3 One Zone-Infrequent Access is similar to S3-IA, but is even less expensive since the data is only stored in a single availability zone with less resiliency. As a result, One-Zone IA is a great option for storing secondary backups.
  • Amazon Glacier is designed for data that is retained for more than 90 days, such as backups or cold data. Glacier is just as durable as Standard S3, but the tradeoff is that it takes 3–5 hours with standard retrievals to restore data.

Use Cloudwatch and Trusted Advisor to monitor costs

Trusted Advisor and CloudWatch are monitoring and management tools to access your instance metrics. Based on the data collected, you can assess your workloads and scale your instance size up or down.

AWS Trusted Advisor is an online tool that provides you real time guidance to help you provision your resources following AWS best practices. Trusted Advisor checks help optimize your AWS infrastructure, increase security and performance, reduce your overall costs, and monitor service limits.

AWS CloudWatch provides you with data and actionable insights to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. 

Use Auto Scaling to align your resources with demand

One of the key benefits of cloud computing is the ability to align your resources with customer demand. To handle variable demand or sudden traffic spikes, you can design dynamically for capacity by using Auto Scaling — adding additional resources only when required and turning them off when they are no longer needed.

The benefit of applying Auto Scaling to your application’s architecture isn’t just limited to better cost management. The services also enables you to detect when an instance is unhealthy, and then automatically terminate the instance and relaunch a new version.

Consolidated Billing provides cost savings

Consolidated Billing consolidates payment for multiple Amazon Web Services (AWS) accounts within your company by designating a single paying account. Consolidated Billing enables you to see a combined view of AWS costs incurred by all accounts in your department or company, as well as obtain a detailed cost report for each individual AWS account associated with your paying account. Consolidated Billing may also lower your overall costs since the rolled up usage across all of your accounts could help you reach lower-priced volume tiers more quickly.

Take advantage of Reserved and Spot Instances

Reserved instances

Unlike on-demand instances, a Reserved Instance is a 1 or 3-year commitment to purchasing a reservation of capacity in exchange for a significantly lower hourly rate. By using Reserved Instances, you can save up to 75% over equivalent on-demand capacity. And don’t worry — if you buy a RI and you don’t need it, you can sell it back or buy a shorter duration version in the reserved instance marketplace.

Spot Instances

Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud. Spot Instances are available at up to a 90% discount compared to On-Demand prices. You can use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads.

Source:

aws.amazon.com

read.acloud.guru

Leave a Comment

Your email address will not be published. Required fields are marked *