August 18, 2020

10 approaches to control and reduce AWS costs

Explore this topicOpen ChatGPT

Cloud costs from Amazon Web Services (AWS) can add up quickly for large businesses, but there are cost management tricks & techniques you can employ to save money. The suggestions below can help with AWS cost optimization. Many of the recommendations are applicable to other cloud providers, such as Google Cloud and Microsoft Azure, too.

1. S3 versioning and EBS/RDS snapshots

AWS makes it easy to amass immense amounts of historical data, through Amazon S3 versioning, RDS snapshots and EBS Lifecycle Manager. Keeping a few backups is always a good idea, but careful planning is needed to ensure storage costs don’t grow linearly. Lifecycle policies for S3, ECR and EBS are invaluable and can also be used to change storage tiers (i.e., Glacier for S3). For more complex logic, one can configure a regularly invoked Lambda function to explicitly clean up old data. This function can also be used to replicate RDS snapshots across regions for regional resiliency.

2.General-purpose instance classes

When choosing an instance class for ElastiCache, RDS, EC2 or other AWS services, it is tempting to opt for a compute or memory-optimized variant. By and large, these are orders of magnitude more expensive than general-purposes t3.XXX sizes and aren’t needed unless you have specific requirements. AWS’ concept of burstable CPU, governed by CPU credits, works well for the majority of use cases. Using the latest generation of instance type always gets the most performance in a more cost-effective way.

3. Savings plans

Reserved Instances, whereby one makes a 1-year or 3-year commitment for a particular AWS service at a negotiated rate, have been around for a while. In their current incarnation, you can switch between instance classes easily. Savings Plans allow for a broader commitment to a collection of AWS services (namely EC2, Fargate and Lambda), providing more flexibility. Take note to only purchase any commitment as a last resort, after you have already optimized and reduced your environmental footprint as much as possible.

4. RDS multi-AZ and replicas

Enabling multi-AZ for RDS instances or adding an additional instance to an Aurora RDS cluster immediately doubles your costs. This should only be done in production environments where you need the resiliency or extra performance of a read-replica.

5. Resizing ECS task definitions

Above and beyond ECS autoscaling, where the number of tasks for a given service is adjusted using automation, consider adjusting the task definition configuration for the allocated vCPU and memory. Though there are a limited number of supported configuration permutations, lowering either vCPU or memory slightly can have large savings across multiple environments and dozens of tasks. A big advantage of using Fargate over EC2 is that one doesn’t need to worry about provisioning sufficient underlying EC2 instance capacity.

6. Share expensive services across AWS accounts

If you have multiple AWS accounts, consider joining them all to an organization. Not only does this umbrella topology make billing simpler, but it allows you to share certain services for cost-savings. Shield Advanced is priced at $3,000/month per organization and Private Certificate Authorities are $400/month but can be shared across accounts.

7. Thrashing Docker containers

If using ECS Fargate, a common unforeseen expense can be thrashing Docker containers which are failing to properly start up. The ECS service will continue to initiate a new task indefinitely. Each time, the task definition will pull the image from either ECR or Docker Hub consuming a sizeable amount of bandwidth. Over the course of a month, a single failing task can cost multiple terabytes of transfer costs. One can monitor for this with Datadog alerts or CloudWatch alarms.

8. Third-party integrations

Integrations like Datadog, Vanta and Fivetran can be overly aggressive with their sync frequency and breadth of data absorbed. This leads to high CloudWatch metric, Data Transfer and NAT Gateway charges. For each provider, ensure you have only the bare minimum of enabled features (i.e., disabling DMS in Datadog, if not using it) and a reasonable sync frequency (i.e., every 15 mins instead of every 5 mins).

9. Dovetailing services

The headline pricing for all AWS services can be deceiving. Generally priced per hour, a cost of $0.98/hour looks a lot more affordable than $729.12/month. Equations, partial hours and dimensions(i.e., LCUs on ALBs) can further complicate AWS pricing estimates.

However, the biggest hidden cost is all of the ancillary services that each AWS offering relies on. For example, using an ALB can have ‘dovetailed’ costs with CloudWatch metrics, S3 logging, DataTransfer, WAF ACLs, etc., Removing or consolidating any single AWS resource can therefore have knock-on effects to your bill.

10. Expiring credits

Many startups are fortunate enough to acquire credits with AWS, through their Ramp credit card or from the incubator they participated in. While thousands of dollars in free money is nothing to scoff at, AWS sets a finite expiry on the credits, usually 12 months later. Take a periodic look at both your remaining credit balance and the credit expiry to avoid unpleasant surprises. This can be seen under My Billing Dashboard and then Credits.

Try Ramp for free
Share with
Lewis Drummond•Head of Infrastructure & DevOps, Ramp
Lewis is Head of Infrastructure at Ramp and oversees several teams. He has over twenty years of experience in architecting and deploying scalable, secure, and resilient cloud infrastructure, most often within AWS. Alongside financial services, Lewis has previously run large environments in a variety of industries, including education, fashion, healthcare, media, and technology. He lives in New York City.
Ramp is dedicated to helping businesses of all sizes make informed decisions. We adhere to strict editorial guidelines to ensure that our content meets and maintains our high standards.

“I assumed I would have to choose between speed and control. What I found is that you can have both. A well-designed system takes friction out, for the finance function and for everyone else.”

Justin Webster

CFO, Denver Broncos

What it takes to pay for an NFL season: inside the Denver Broncos’ finance rebuild

“A well-run district should not have to choose between getting work done at the school site and keeping control of the dollars behind it. We're not hiring more people to do more jobs, so we have to be smarter about the process. With Ramp, the purchase, the receipt, and the record stay together from the start. ”

Nick Brizeno

Director of Purchasing, San Marcos Unified School District

San Marcos Unified gives maintenance teams room to act — and finance a clear record of their spend across 19 schools

“AI is moving faster than the finance context around it. Prices change, models change, and the value is not always obvious from an invoice. We needed enough detail to know which bets deserved more investment — and which ones did not.”

Greg Cooley

Controller, AngelList

From purchase requests to 409 API keys: How AngelList puts spend under owner-level control

“Invoices, cards, tokens. The categories change but the principle doesn't: know where the money is going, remove the work around it, and make sure the spend is worth it.”

Maciej Mylik. Finance

ElevenLabs

ElevenLabs speaks more than 70 languages but its money speaks the same one

“We weren’t trying to retrofit an old finance system. We had a blank canvas, and Ramp gave us the foundation to build a global finance function of the future.”

Justin Dourado

Director of Finance, Othership

How Othership’s first finance hires built one operation across Canada and the U.S.

“There's just no surprises anymore. No more waiting two months to find out how a job did. We know how it's doing as it's happening.”

Erich Kuss

Financial Systems Manager, Infinity Home Services

Infinity Home Services prevents the margin leak nobody can see from the ground, so its 20+ local companies build what they bid

“More token spend isn’t proof that AI is working. Less isn’t proof that it isn’t. What matters is whether we’re buying the right level of intelligence for the work. Ramp lets us make that judgment in the same place we manage every other type of spend.”

Cody Nutt

Senior Director of Business Systems, Daxko

How Daxko put every AI token on the same operating system as every dollar

“Most banks treat the back office as a cost to keep down. We treat ours as a return to compound, which is why we run it on Ramp. Now we put our clients on Ramp, too.”

Patrick Gaughen

President & COO, Hingham Institution for Savings

The 192-year-old bank that banks on Ramp to take the waste out of its own books