• 4 minute read
  • Top 6 AWS Cost Optimization Strategies to Slash Your Cloud Bills

    CTO at Decentro. Making fintech great again!

    Explore practical AWS cost optimization tips to cut cloud costs. From managing EIPs to migrating volumes, these strategies will help lower your AWS bills.

    Amazon Web Services (AWS) provides immense flexibility and scalability, making it a company’s go-to platform. However, cloud costs can quickly escalate. AWS offers a variety of tools, like Cost Explorer, that can be used to optimize costs significantly, but we still have to rely on manual efforts to make changes.

    Cost Explorer is a great way to dissect your current and estimated costs by many parameters. These can include period, services used on AWS, Linked account, Region, and many other options. This helps us get granular. 

    This blog post will explore six strategies for optimizing AWS costs without compromising performance.

    Top 6 AWS Cost Optimization Strategies to Slash Your Cloud Bills

    All of these strategies have been applied in our organisation to save costs.

    Monitor Burstable Credits for T-Series Instances

    Monitor Burstable Credits for T-Series Instances

    AWS T-series instances (T2, T3, T3a) offer a cost-effective way to run workloads with spiky or inconsistent CPU demand. These instances utilize burstable credits, which allow them to handle periods of high usage.

    I would personally suggest that you should go through this link to understand key concepts about burstable credits.
    However, when you run out of burstable credits, AWS provides these CPU credits at a cost that adds up very quickly to the bill. To optimise costs and ensure your workloads run efficiently:

    • Monitor credit balance: Use CloudWatch metrics to monitor CPU credit usage. Instances that deplete their credits frequently might be overutilized, costing you more in performance bottlenecks.
    • Right-size instances: If credits are being depleted too often, consider moving to a larger instance. A consistently low credit balance might suggest you need a higher baseline CPU.
    • Switch to non-burstable instances: For workloads that require sustained high performance, switching to M or C series instances may be more cost-effective in the long run. A small caveat is that these instances are mostly available for large or bigger instance sizes.

    Manage Elastic IPs

    Elastic IPs (EIPs) are static IP addresses assigned to EC2 instances, Load Balancers, etc., useful when you need a consistent IP for your services. However, AWS charges for any EIPs, whether used or not, making it essential to manage them effectively.

    • Release unused Elastic IPs: AWS charges a nominal fee for any Elastic IP. Regularly audit your environment and release any unused EIPs to avoid unnecessary charges.
    • Check whether you need the elastic IPs. Most computes can run in a private subnet behind an API Gateway or Load Balancer.

    Migrate EBS Volumes from gp2 to gp3

    Comparing gp2 and gp3 EBS volumes for cost and performance

    Amazon Elastic Block Store (EBS) gp2 volumes have been the go-to for many AWS users, but AWS has introduced gp3, which offers the same performance at a lower price point.

    • Lower storage cost: gp3 volumes are 20% cheaper than gp2, providing an instant cost reduction without sacrificing performance. In reality gp3 might provide better performance than gp2.
    • Optimize IOPS and throughput: With gp3, you can independently configure IOPS and throughput, allowing you to fine-tune performance according to your workload’s needs, which can prevent over-provisioning and reduce costs. GP3 already comes with 3000 IOPS as a baseline, which should be good enough for most use cases.
    • RDS volumes upgrade: This migration is also very valid for your RDS instances, which usually have a very high storage capacity. Applying the migration can help in reducing upto 20% of Storage costs for RDS 

    Switch EC2 Instances to ECS Spot Instances

    Cost Optimizarion with EC2 Spot Instances

    Amazon EC2 Spot Instances allow you to purchase unused EC2 capacity at significantly reduced rates, up to 90% off the on-demand price. These instances are ideal for fault-tolerant, flexible workloads and can drastically cut costs.

    • Containerize workloads with ECS: Amazon Elastic Container Service (ECS) combined with Spot Instances is an excellent way to optimise costs for managing instance traffic, background processes and batch operations. ECS automatically manages the Spot lifecycle, making it easier to handle interruptions.
    • Use Spot Fleet: Spot Fleet allows you to run a mix of Spot and On-Demand Instances, ensuring that your workloads always have capacity when needed while maximizing cost savings.
    • Instance diversification: Diversify across different instance types and availability zones to increase the likelihood of successfully running Spot Instances with fewer interruptions.

    Transition EBS Volumes from gp3 to Magnetic

    Moving from gp3 volumes to magnetic volumes (standard HDD) can provide further cost reductions in cases where storage performance is not critical.

    • Lower storage costs: Magnetic volumes are cheaper than both gp2 and gp3, making them ideal for infrequently accessed data or backup storage.
    • Use for archival purposes: Magnetic volumes offer a cost-efficient solution for storing large amounts of data that are rarely accessed but need to be retained.

    Reduce the retention period on RDS automated snapshots

    We all require RDS automated snapshots for that rainy day when our instance might have trouble, but do we require multiple days of retention when we just need the latest snapshot?

    • Reducing backup retention period: This configuration can be found while modifying an RDS instance. Reducing the value to a reasonable number of days will help manage snapshot costs.

    Conclusion

    Implementing these AWS cost optimisation techniques can significantly reduce your cloud infrastructure expenses while maintaining performance and reliability.  Within Decentro, we have used these measures to get close to the following reductions in the overall bill:

    1. Credit Balance for burstable instances: ~1.5%
    2. Elastic IP addresses: ~0.36%
    3. Migrate gp2 to gp3: ~2.2%
    4. EC2 to Spot: ~2% (It is slightly debatable as we also have a cost savings plan)
    5. Migrate gp3 to gp2: 0.02%
    6. Reduce the retention period for RDS snapshots: ~4.2%

    These numbers might vary for your operation, but they represent a significant reduction in the overall bill in dollar terms.

    Regular monitoring, right-sizing instances, and leveraging tools like EBS gp3 volumes and Spot Instances can lead to substantial long-term savings. Combined with automated workflows, these strategies ensure your AWS environment remains cost-effective, scalable, and future-ready.

    Always monitor your usage patterns, and consider using AWS Cost Explorer or Bills to track and manage spending more effectively. 

    With this, I hope to lower your AWS bills by a few percentage points.

    If you wish to read more such blogs, please check our website’s [Blogs] section. We have previously covered topics like JsPDFLocust, and much more.