Skip to content

What are the main points on AWS cost optimisation on AWS resources

AWS resources are basically designed on a per-use basis. If you use any resources, you pay, but if you stop using it or putting in hibernate states, there is no or very little cost on AWS resources. 

The content below is all derived from AWS documentation, I have compiled them together so that it will be easier to find all the AWS cost optimization resources in one place so that we don’t have to go back and forth. 

Route 53

Route53 charges are based on actual usage of the service for: 

  • Hosted Zones 
  • Queries 
  • Health checks 
  • Domains Names

To reduce higher than expected Route53 costs: 

  • Delete unused hosted zones:

There’s a monthly charge for each hosted zone created in Route 53. When you create a hosted zone for your domain, Route 53 assigns a set of four name servers to the hosted zone. For public DNS resolution, only the hosted zone that has the name servers added at the domain registrar is used to resolve queries. To minimize costs related to the hosted zone, delete any unused hosted zones.

  • Create alias records where possible

There’s a charge for most DNS queries answered by Route 53. The exception to this policy queries to alias records mapped to resources provided at no cost, including:

Elastic Load Balancing instances, Amazon CloudFront distributions, AWS Elastic Beanstalk environments, Amazon API Gateways, Virtual private cloud (VPC) endpoints, Amazon Simple Cloud Storage (Amazon S3) website buckets

  • Increase the TTL for the records

There’s a charge for most DNS queries answered by Route 53. The exception to this policy queries to alias records mapped to resources provided at no cost, including Elastic Load Balancing instances, CloudFront distributions, AWS Elastic Beanstalk environments, API Gateways, VPC endpoints, Amazon S3 website buckets

  • Review your traffic policy records

The traffic policy manages traffic for that specific DNS name. Traffic policies are generally a best practice for the combination of the routing policies and for the geo proximity routing policy. There’s no charge for traffic policies that aren’t associated with a DNS name through a policy record.

To associate multiple domains with the same traffic policy, create an alias record in the same hosted zone as the traffic policy record. For example, you can create a traffic policy record for example.com, and an alias record for www.example.com that references the traffic policy record.

To further reduce costs, review your traffic policy records. Determine if the traffic policy records can be replaced with simple records or other routing policies.

  • Review your Resolver endpoints 

A Route 53 Resolver endpoint requires two or more IP addresses. Each IP address corresponds with one elastic network interface. Elastic network interfaces are charged at a rate of $0.125 per hour, per interface.

A single outbound endpoint can be shared among multiple VPCs that were created by multiple accounts within the same Region. If you configured multiple outbound endpoints with different VPCs in the same region, you will incur additional charges. To reduce costs, consolidate your endpoints using the shared mechanism rather than using individual endpoints.

  • Delete unnecessary health checks

When you associate health checks with an endpoint, health check requests are sent to the endpoint’s IP address. These health check requests are sent to validate that the requests are operating as intended. Health check charges are incurred based on their associated endpoints. To avoid health check charges, delete any health checks that aren’t used with an RRset record and are no longer required.

EC2

  • Use EC2 Spot Instances where possible

If you don’t have mission-critical applications and can withstand some fluctuation then this is the best instance to go for. You can take advantage of unused EC2 capacity for up to 90% off On-Demand pricing. Spot Instances are perfect for fault-tolerant, stateless applications like containers, big data, AI/ML, and more.

  • Use Savings Plan

Save up to 72% on EC2, Fargate, and Lambda, when you commit to a consistent amount of usage (measured in $/hour) with a 1 or 3-year term. Savings Plans are similar to Reserved Instances in that they are commitment-based, but offer more flexibility as the savings can be applied across different instance types and Regions.

  • Use EC2 Auto Scaling

Improve application resiliency and availability by automatically adding or removing EC2 instances and by mixing multiple purchase options and instance types. EC2 Auto Scaling ensures you are not over or under-provisioning compute to match application demand.

  • Using AWS Compute Optimiser

Take the guesswork out of selecting the right instance. AWS Compute Optimizer recommends instances that balance performance and cost for running workloads. By using the rightsizing recommendations you can save up to 25% on EC2 costs.

  • EC2 Instance Discovery

Rightsize your compute environment before starting your workload. Specify your hardware requirements and EC2 Instance Discovery will serve you a list of compatible instances to compare across CPU, memory, storage, networking performance, regional presence, pricing, and more.

  • AWS Cost Explorer

Eliminate underutilized resources with AWS Cost Explorer. AWS Cost Explorer identifies underutilized EC2 instances that may be downsized within the same instance family and provides forecasted spend based on optimization changes you make.

RDS

For optimizing your Amazon Relation Database Service (RDS) and reduce the cost of operation we can have the following best practices in use: 

Approach: 

This Amazon RDS cost-optimization approach consists of the following key steps:

  1. Tag and track resource utilization.
  2. Define the utilization policies for your Amazon RDS resources.
  3. Educate the owners and implement the policies.
  4. Learn and optimize the policies and processes.

Tagging and tracking the resource utilization:

The first step towards cost-optimization is to properly tag your resources and start tracking their utilization. Amazon RDS automatically sends metrics to Amazon CloudWatch every minute for each active database instance. There are no additional charges for Amazon RDS metrics in CloudWatch.

This integration of Amazon RDS with CloudWatch makes it easy to track resource utilization. The next step is to develop a policy that helps you identify the opportunities for cost-optimization.

After the metrics are in your hand it will be easier to decide on three key Amazon RDS aspects: 

  • Use Read Replicas

Amazon RDS read replicas provide enhanced scalability and durability for RDS DB instances. These read replicas provide the capability to scale read traffic horizontally. This is particularly beneficial for read-heavy database workloads.

  • Unused Instances

Unused RDS instances add to the overall cost and don’t add any value. It’s recommended that all unused instances are identified and shut down as per the policy defined by your organization. Instances are sometimes created in non-production environments for quick testing and never cleaned up after the work is complete. These unused instances stay unutilized and unnecessarily add to the cost. To identify unused instances, consider the following criteria:

    • No database connections for 1 month (or less, depending on your requirements)
    • CPU utilization and I/O are less than 5% constantly
  • Primary Instances

The primary RDS instance handles read and write traffic for your application. Therefore, it’s essential that it’s sized correctly to meet your application requirements. At the same time, you don’t want to leave it under-utilized. To identify under-utilized primary instances, look for instances with CPU utilization less than 30% and I/O less than 30% constantly.

After you identify the under-utilized instances, complete the following steps:

    1. Notify the database and application owners to right-size the instance.
    2. Include a deadline to right-size the instance or get an exception.
    3. Send a reminder and escalate when the deadline expires.

S3

Amazon S3 lets you take control of costs and continuously optimize your spend while building modern, scalable applications. Amazon S3 Storage Classes offer the flexibility to manage your costs or have it automated for you, by providing different data access levels at corresponding costs, including the lowest-cost cloud storage.

  • Automatic Savings with S3 intelligent-Tiering, which optimizes storage costs for you.
  • S3 Storage classes optimize costs and performance for all workloads.
  • 99.99999999999% 11 9’s of durability across all storage classes
  • Storage in the cloud with S3 Glacier Deep Archive for not frequently used data.
  • Use lifecycle policy to move unused data to the lower-cost storage services. 

ElasticSearch

Amazon Elasticsearch Service is a fully managed service that makes it easy for you to deploy, secure, and run Elasticsearch cost-effectively at scale. 

With Amazon Elasticsearch Service, you pay only for the resources you consume. You can select on-demand pricing with no upfront costs or long-term commitments, or achieve significant cost savings via our Reserved Instance pricing. As a fully managed service, Amazon Elasticsearch Service further lowers your total cost of operations by eliminating the need for a dedicated team of Elasticsearch experts to monitor and manage your clusters.

Cloudfront

Amazon CloudFront pricing options:

  • Free-tier: If you are unsure if CloudFront is right for you, you can always start with the free-tier eligible account for the first year. As the name suggests you get to use Amazon CloudFront for free with the AWS Free Usage Tier. Once you sign-up as a new AWS customer you receive 50 GB of Data Transfer Out and 2,000,000 HTTP/HTTPS requests each month for a year. Even if your usage is higher, you will only be billed for the usage above this allowance.

  • On-demand: Your costs are determined by pay-as-you-go pricing and the actual usage of CloudFront services. You pay for what you use.

  • AWS discounted pricing: You can get discounts on Data Transfer Out of AWS if you reserve capacity and commit to using more than 10 TB per month.

Cloudwatch

You can get started with Amazon CloudWatch for free. Most AWS Services (EC2, S3, Kinesis, etc.) send metrics automatically for free to CloudWatch. Many applications should be able to operate within these free tier limits.

Every request to Cloudwatch cost money that are not Freetier. The more requests, the greater the expenditure. The important metrics that cost money are:

  • RDS related metrices
  • CPU credit balance for EC2 instances
  • Size of EC2 Auto Scaling Groups
  • Summary costs per AWS Account

So after watching the requests generated by Cloudwatch we can decide to change the frequency of gathering data depending on the priority of the requests. 

Cloud Trial

AWS CloudTrail can be used for security, monitoring restricted API calls, notification of threshold breaches, operational issues, filtering mechanisms for isolating data, faster root cause identification, and speedy resolution. CloudTrail can also be used for various compliance and governance controls, by helping you achieve compliance by logging API calls and changes to resources.

We can optimize AWS CloudTrail costs by using advanced event selectors.

Event selectors allow you to add a level of customization to the type of API request you want the trail to capture. Data events provide visibility into the data plane resource operations performed on or within a resource. You can currently log data events on two resource types:

  • Amazon S3 object-level API activity (for example, GetObject, DeleteObject, and PutObject API operations).
  • AWS Lambda function execution activity (the Invoke API).

The advantages of using advanced event selectors for AWS CloudTrail include:

  • The flexibility to choose only important events means you can control which CloudTrail data events you want to log and pay for. For example, you can choose to log only PutObject or DeleteObject events.
  • A trial can have up to five event selectors. You can add advanced event selectors, and conditions for your advanced event selectors, up to a maximum of 500 values for all conditions and selectors on a trail.
  • Because advanced event selectors provide more granular control of data event logging, you can choose from the field conditions to better identify issues.
  • Similar to regular expressions, advanced event selectors support including or excluding values with pattern matching on partial strings.
Leave a Reply

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