How Can You Save Costs on AWS?
Amazon Web Services (AWS) offers several discounted pricing models that can help you optimize and reduce costs.
For example, spot instances offer the use of spare capacity for up to 90% off the on-demand price. Reserved instances and Saving Plans offer significant discounts in return for a long term commitment. The AWS Free Tier offers resources that are either always free or a limited amount of resources offered free of charge during a specific period of time.
In addition to these pricing models, you can implement several best practices that can help you better utilize resources, reduce waste, and conserve costs. We’ll cover seven of these techniques later in this article.
This is part of our series of articles about AWS costs.
In this article, you will learn about the following ways to save on AWS:
- Reserved Instances (RIs): Offer significant discounts in exchange for a long-term commitment
- Spot Instances: Offer the use of spare capacity for up to 90% off the on-demand price.
- AWS Saving Plans: A pricing model with savings of up to 72% on AWS usage. There are three types—Compute Savings Plans, EC2 Instance Savings Plans, and Amazon SageMaker Savings Plans.
- AWS Free Tier: Offers many AWS services for free up to specified limits
- Volume Discounts: AWS offers lower pricing for most services as volumes grow.
- Stopping or Downsizing Amazon EC2 Instances: Regularly monitor the CPU, memory, and network utilization of your EC2 instances.
- Delete Unattached EBS Volumes: Regularly review and delete unattached volumes to avoid unnecessary charges.
- Analyze Amazon S3 Usage and Leverage Storage Tiering: Move infrequently accessed data to cheaper storage classes like S3 Infrequent Access or Glacier to save on storage costs.
- Review and Modify EC2 Autoscaling Groups Configuration: Ensure that your autoscaling groups are configured to avoid overprovisioning.
- Reuse or Sell Underutilized RIs: Reserved Instances (RIs) that are no longer needed can be sold on the AWS Reserved Instance Marketplace.
- Identify and Delete Orphaned Snapshots: Regularly review and prune unnecessary snapshots to avoid storage charges.
- Analysis of Amazon DynamoDB Usage and Cost Reduction: Adjust provisioned capacity or leverage DynamoDB auto-scaling to optimize costs without compromising performance.
5 Official AWS Cost Saving Models
Reserved Instances (RIs)
RIs offer significant discounts for customers willing to commit to using AWS resources for a long term duration of 1 or 3 years. This model lets you reserve instances and other services in advance and use them as needed.
You can pay upfront for the entire reserved capacity, pay partial upfront, or no upfront. Upfront payment provides the highest discount rate, but creates a larger financial risk for the customer.
There are several types of RIs on AWS. Standard RIs can be sold to 3rd parties on the AWS RI Marketplace. Convertible RIs require a commitment for a certain AWS region, and you can change the instance family at any time. However, note that convertible RIs cannot be sold in the AWS RI Marketplace, so you cannot offload them before the end of the term.
AWS offers massive discounts—up to 90%—by offering customers the option to use spare compute capacity. Spot instances are essentially compute resources that are sitting idle. To ensure these resources do not go to waste, AWS offers this capacity at a discounted rate.
Spot instances provide the deepest savings of any cloud pricing model. However, there are certain aspects that can significantly impact operations. In AWS, once a spot instance is required by on-demand or reserved customers, it is terminated with just a 2-minutes notice.
Saving Plans offer discounts for AWS customers committing to using AWS during a period of 1 or 3 years. This option lets you commit to a level of spend, and gain discounts on AWS compute services, including Amazon Elastic Compute Cloud (Amazon EC2), AWS Fargate, and AWS Lambda. Once you set this up, you’ll pay the regular hourly on-demand rate, and the discount will be applied at the billing stage after Amazon confirms your total spend.
AWS Free Tier
The free tier offers the use of free AWS resources. Some are restricted to a limited number of months while others are always free. There are three main types of Free Tier offerings—short term trials, Always Free products, and the 12-month Free Tier.
The 12-months Free Tier lets you sample AWS resources for free. You can use these resources for a duration of 12 months or until you reach the maximum capacity allotted to this resource. Always Free products are available forever, at no cost, for all AWS accounts.
Short trial offerings come with a limited amount of time or a one-time limit, letting you sample the service and see if it is the right fit for your project. Once you exceed the limits you start paying the on-demand rate.
You can find all limitations and specifications for the AWS Free Tier on the official page.
To ensure billing is consistent across all organizational accounts and enable volume discounts, AWS treats all organization accounts as one account. Once accounts are consolidated, AWS combines usage data from across all accounts and then applies the relevant volume pricing tier.
The volume pricing tier provides a lower total price on consolidated resources, and then allocates a portion of the overall volume discount to each member account according to the usage of each account.
Learn more about volume discounts on Amazon’s official page.
7 AWS Cost Savings Best Practices
The following best practices can help you make more efficient use of AWS resources and conserve costs.
Stopping or Downsizing of Amazon EC2 Instances
Here are several tools you can use to optimize resources and costs:
- AWS Cost Explorer Resource Optimization—provides reports on underutilized or idle EC2 instances. You can optimize and reduce your AWS costs by downsizing or stopping these instances.
- AWS Instance Scheduler—can reduce manual work by automatically stopping instances when they are not needed.
- AWS Operations Conductor—uses Cost Explorer recommendations to automatically resize EC2 instances.
- AWS Compute Optimizer—lets you view recommendations within instance families and across families, including upsizing and auto scaling recommendations.
Delete Unattached EBS Volumes
You can attach EBS volumes to EC2 instances—these are virtualized hard disks that provide high performance persistent storage. When an EC2 instance is terminated, this does not automatically delete the attached EBS volumes, unless you explicitly select the option to “delete on termination”, or the EBS volume is defined as the root volume of the instance.
It is very common to have “orphaned” EBS volumes in an AWS account, long after their parent EC2 instances were destroyed. Each EBS volume continues to accumulate storage costs.
It is important to gain visibility into unattached EBS volumes, understand if their data is necessary, and either delete them, reattach them to another volume, or move their data to a more cost effective storage option, such as S3.
Analyze Amazon S3 Usage and Leverage Storage Tiering
You can leverage S3 Analytics to identify and analyze storage access patterns on an object data set—you can evaluate patterns over a duration of 30 days or more. This tool provides recommendations on where and how to leverage the S3 Infrequently-Accessed (S3 IA) tier to reduce your storage costs.
Two other options to leverage lower cost storage tiers:
- Use S3 lifecycle policies to automatically move your objects into a lower cost storage tier.
- Use the S3 Intelligent-Tiering feature, which automatically analyzes and then moves your objects to another, more appropriate storage tier. Keep in mind that this comes at additional cost per GB-month.
Review and Modify EC2 Autoscaling Groups Configuration
EC2 autoscaling groups can help you shrink or expand EC2 fleets according to demand. You can review scaling activities using the describe-scaling-activity CLI command. An analysis of the results should help you see if a scaling policy should be tuned. Additionally, you should review your settings to check if you can reduce the minimum capacity, and serve end user requests using a smaller fleet.
Reuse or Sell Underutilized RIs
When purchasing RIs, you pay for resources you estimate you will need in the future. In some cases, you might end up with idle resources. To ensure you make use of your investment, you can relocate the instances to a new project or another application that is in need of this capacity. Additionally, you can repurpose the RIs for existing workloads currently running on expensive on-demand resources. Alternatively, you can sell idle Standard RIs on the AWS marketplace.
Identify and Delete Orphaned Snapshots
After you terminate an EC2 instance, EBS volumes may or may not be deleted. However, your snapshots remain and continue accumulating charges, which can add up to a large sum. While backups are typically incremental, the first snapshot made is of an entire volume, and can have substantial costs over time.
Regular snapshots taken over a long period of time may need as much capacity as the first snapshot. Even if you keep your snapshots in cheap S3 storage, it can still accumulate into a large expense. To save on costs, consider deleting the first snapshot of the entire volume, and other snapshots as soon as they are no longer required.
Analysis of Amazon DynamoDB Usage and Cost Reduction
If you use Amazon DynamoDB as part of your Amazon deployment, set up metrics and monitor consumption to ensure it does not accumulate unnecessary costs. You can use CloudWatch metrics like ConsumedWriteCapacityUnits and ConsumedReadCapacityUnits to monitor DynamoDB usage.
Once you have a monitoring system in place, you can analyze the data, gain insights into resource consumption, and optimize utilization and costs. You can leverage autoscaling to scale DynamoDB to the appropriate size. Be sure to enable this feature on all existing tables.
Alternatively, you can try the on-demand feature, which allows you to pay for DynamoDB on a pay-per-request basis for read and write requests.
Automating AWS Cost Savings with Spot by NetApp
While AWS offers Savings Plans, RIs and spot instances for reducing EC2 cost, these all have inherent challenges:
- Spot instances can be 90% less expensive than on-demand instances, however, as spare capacity, AWS can reclaim those instances with just a two minute warning, making them less than ideal for production and mission-critical workloads.
- AWS Savings Plans and RIs can deliver up to 72% cost savings, but they do create financial lock-in for 1 or 3 years and if not fully utilized can end up wasting money instead of saving it.
Spot by NetApp addresses these challenges, allowing you to reliably use spot instances for production and mission-critical workloads as well as enjoy the long-term pricing of RIs without the risks of long-term commitment.
Key features of Spot by NetApp’s cloud financial management suite include:
- Predictive rebalancing—identifies spot instance interruptions up to an hour in advance, allowing for graceful draining and workload placement on new instances, whether spot, reserved or on-demand.
- Advanced auto scaling—simplifies the process of defining scaling policies, identifying peak times, automatically scaling to ensure the right capacity in advance.
- Optimized cost and performance—keeps your cluster running at the best possible performance while using the optimal mix of on-demand, spot and reserved instances.
- Enterprise-grade SLAs—constantly monitors and predicts spot instance behavior, capacity trends, pricing, and interruption rates. Acts in advance to add capacity whenever there is a risk of interruption.
- Serverless containers—allows you to run your Kubernetes and container workloads on fully utilized and highly available compute infrastructure while leveraging spot instances, Savings Plans and RIs for extreme cost savings.
- Intelligent and flexible utilization of AWS Savings Plans and RIs—ensures that whenever there are unused reserved capacity resources, these will be used before spinning up new spot instances, driving maximum cost-efficiency. Additionally, RIs and Savings Plans are fully managed from planning and procurement to offloading unused capacity when no longer needed, so your long-term cloud commitments always generate maximum savings.
- Visibility and recommendations—lets you visualize all your cloud spend with the ability to drill-down based on the broadest range of criteria from tags, accounts, services to namespaces, annotations, labels, and more for containerized workloads as well as receive cost reduction recommendations that can be implemented in a few clicks.