Monday, April 29, 2024
No menu items!
HomeDatabase ManagementAWS tools to optimize your Amazon RDS costs

AWS tools to optimize your Amazon RDS costs

Customers are actively exploring opportunities to optimize their expenses, aligning with the Cost Optimization pillar of the AWS Well-Architected Framework. In this post, we discuss the following tools that you can use to analyze your spend and optimize your Amazon Relational Database Service (Amazon RDS) costs:

AWS Trusted Advisor
Instance Scheduler on AWS
AWS Backup
Cloud Intelligence Dashboards in Amazon QuickSight
Amazon CloudWatch metrics

AWS Trusted Advisor

AWS Trusted Advisor is a valuable tool for optimizing costs, not only for Amazon RDS but also for various other AWS resources. Customers with Business Support or higher get access to 115 Trusted Advisor checks, including 14 cost optimization recommendations. Trusted Advisor can assist in optimizing Amazon RDS costs in the following ways:

Idle DB instances – Trusted Advisor provides valuable insights into idle RDS instances. It identifies instances with low or no utilization, categorizing them as idle, and recommends actions such as deletion or stopping. These actions help eliminate unnecessary costs associated with underused resources.
Overutilized DB instances – This check identifies RDS instances that are consistently overutilized in terms of CPU, memory, or storage. It recommends scaling up the instance size or implementing other optimizations to improve performance and potentially reduce costs.
Underutilized DB instances – This check identifies RDS instances that are underutilized, suggesting that you may be paying for more resources than you need. You can downsize or modify the instance type to a smaller instance to save costs.
Idle DB connections – Trusted Advisor can also identify RDS instances with a high number of idle database connections. This might indicate inefficient resource allocation, and it recommends optimizing database connections to reduce resource consumption.
Multi-AZ settings – Trusted Advisor may suggest enabling a Multi-AZ (Multi-Availability Zone) configuration for critical RDS databases. It’s worth noting that AWS recommends Multi-AZ for production RDS clusters to ensure high availability, even though this can lead to an associated increase in costs.
Configuration recommendations – This general optimization check evaluates various aspects of your RDS configuration, including instance size, storage, and performance. It provides recommendations to improve resource efficiency and reduce costs.

Trusted Advisor can streamline the process of identifying cost-saving opportunities for Amazon RDS and other AWS resources. By regularly reviewing Trusted Advisor recommendations and acting on them, you can effectively manage AWS costs while ensuring that your infrastructure meets your performance requirements.

Instance Scheduler on AWS

If you have RDS instances that are running at full utilization but are only necessary during regular business hours, consider starting and stopping these instances to reduce costs. For example, these could be RDS instances running in a dev or test environment or specific instances in a production environment. By stopping instances outside of business hours, you can save up to 70% on Amazon RDS spend.

After you identify workloads that fit this use case, rather than manually starting and stopping each instance, you can use the Instance Scheduler on AWS solution. AWS solutions are technical reference implementations built and vetted by AWS Solutions Architects and AWS Partners designed to help customers solve common problems.

Instance Scheduler on AWS is a straightforward, automated scheduling solution that starts and stops tagged instances. You can schedule when these instances should be started or stopped by adding, updating, or removing schedules using either the Amazon RDS console or the solution’s command line interface.

To deploy Instance Scheduler on AWS, choose Launch in the AWS Console for one-click deployment in any AWS Region. After it’s deployed, the solution applies the appropriate start or stop actions to tagged RDS instances in all Regions, which will help reduce instance utilization and in turn reduce overall cost.

AWS Backup

One of the benefits of using a managed service like Amazon RDS is its native snapshot capability. There are two types of RDS snapshots: automated and manual. Amazon RDS initiates an automated snapshot during a daily backup window, whereas customers can initiate manual snapshots at any time using the RDS create snapshot API.

Both automated snapshots and manual snapshots incur billing charges until they’re deleted. If you have any long-term storage requirements, you can use AWS Backup to move your backups to colder storage. For more information, see Lifecycle and Retention costs. Therefore, it’s important you review your RDS snapshot lifecycle policies and remove both manual and automatic snapshots based on your organization’s compliance and retention policies. Automatic snapshots are deleted as per the retention policy you define, but manual snapshots are never deleted automatically. For more information, see Working with backups.

For organizations that have many resources and desire a single view to manage their backups, AWS offers AWS Backup. AWS Backup is a centralized service that offers backup scheduling, retention management, and backup monitoring. AWS Backup builds on top of existing service backup capabilities while providing a common way to manage backups across many RDS instances and supported services.

With the native service snapshot capability and AWS Backup, you can make sure your data retention practices align with your organization’s business objectives, their Recovery Time Objective (RTO), and their Recovery Point Objective (RPO) goals. Aligning your business needs with your data retention strategy allows you to mitigate unnecessary storage costs.

Cloud Intelligence Dashboards

The Cloud Intelligence Dashboards are a collection of Amazon QuickSight dashboards that executives, directors, and other individuals can deploy in their own AWS accounts. These dashboards allow you to visualize cost and usage reports, identify trends and patterns, and recognize areas for cost optimization.

For example, to visualize database spend, you can deploy the Cost and Usage Dashboards Operations Solution (CUDOS) dashboard. This dashboard contains a summary sheet for all databases deployed, including Amazon RDS, Amazon Redshift, Amazon OpenSearch Service, and more. It includes such recommendations as using Single-AZ deployments for non-business-critical database instances and Multi-AZ deployments for business-critical database instances. You can view database spend by different dimensions such as purchase options (for example, On-Demand compared to Reserved Instances), instance family, instance type, or processor type. You can view daily storage costs to identify trends and insights, providing opportunities to reduce cost. To get started using the CUDOS dashboard, refer to Creating Cost and Usage Reports. The following screenshot shows the Trusted Advisor Organizational (TAO) dashboard, which has a sheet dedicated to cost optimization.

For example, you can see potential savings from idle RDS instances using a KPI visual, or you can use the bar chart to view monthly estimated savings over the past 2 months. To review each instance, refer to the detailed table, which lists each idle RDS database. The following screenshot shows how many days have passed since the last database connection, and the estimated monthly savings that you will incur after you delete that instance.

To learn more about these dashboards, see A Detailed Overview of the Cost Intelligence Dashboard. To deploy any or all of these dashboards, refer to the Cloud Intelligence Dashboards lab portion of the Well-Architected Labs.

Amazon CloudWatch

Amazon CloudWatch provides a set of valuable metrics and insights for Amazon RDS, allowing you to closely monitor, alert, and optimize costs. The following are some key CloudWatch metrics in the context of Amazon RDS cost optimization:

CPU utilization – CPU usage metrics help you understand how much computational power RDS instances consume. By monitoring this metric over time, you can identify periods of high and low usage. During low utilization periods, consider downsizing to a smaller instance type or implementing auto scaling to save costs.
Database connections – Monitoring the number of database connections can help you detect unusual spikes in traffic. An unexpectedly high number of connections might indicate a need for additional database resources. Conversely, consistently low connection counts could suggest that you can downgrade instance size to optimize costs.
Freeable memory – This metric indicates the amount of memory available for a selected RDS instance. If you notice that freeable memory is consistently high, it may be an opportunity to switch to a smaller instance type or allocate memory more efficiently within the database.
Read and write IOPS – Input/output operations per second (IOPS) metrics help assess your database’s disk performance. Consistently hitting the provisioned IOPS limits may be a sign that you need to adjust the IOPS allocation or consider a different storage type. Over-provisioning IOPS can be a significant cost driver.
Storage usage – You should closely monitor RDS storage usage. You can utilize Enhanced Monitoring metrics such as os.fileSys.usedPercent and os.disks.availPc for assessing disk utilization. These metrics are accessible through CloudWatch logs. If the storage usage consistently approaches the provisioned limit, consider resizing the storage to avoid incurring additional charges. Furthermore, it is advisable to perform routine data cleanup and implement effective database archiving strategies to optimize storage costs.
Replication lag – If you’re using read replicas in Amazon RDS, a high replication lag could signal performance issues or the need for additional replicas. Optimizing your read replica strategy is crucial for balancing performance and cost.
Database throughput – You should assess your database’s throughput to determine if it’s over- or under-provisioned. Utilize real-time Amazon RDS metrics for the operating system (OS) on which your DB instance runs. These metrics include TPS (I/O transactions per second), Disk I/O Utilization, Write IO/s, Write Throughput, Read IO/s, and Read Throughput to analyze database activity and identify bottlenecks. Additionally, optimizing queries and indexing can contribute to achieving the desired throughput with fewer resources.
Query performance – Although this isn’t a direct CloudWatch metric, you can use Amazon RDS Performance Insights to identify top SQL queries contributing to high database load and optimize them.
Billing metrics – AWS also provides billing metrics that can be monitored via CloudWatch. These metrics show Amazon RDS costs over time, and by correlating them with other performance metrics, you can assess the impact of different configurations and associated costs.

Conclusion

In this post, we looked at five tools that allow you to monitor and optimize your Amazon RDS spend. Using these tools you can identify cost-saving opportunities for Amazon RDS and other AWS resources.

We recommend you to review your Trusted Advisor recommendations, including 14 cost optimization recommendations. We also recommended to identify workloads that are only necessary during regular business hours and start and stop them using Instance Scheduler. Additionally, we encourage you to use AWS Backup to align your backup and retention strategy with your business needs to mitigate unnecessary storage costs. We also discussed how you can visualize Amazon RDS spend in QuickSight to identify trends and patterns, and optimize cost by driving financial accountability. Finally, we recommend to review your metrics in Amazon CloudWatch, which provides a set of valuable metrics and insights for Amazon RDS, allowing you to closely monitor, alert, and optimize costs.

For more information about cost optimization of other AWS services, refer to Cost Optimization of “other” services.

If you have any questions, reach out to AWS Support and your AWS account team if you need further assistance in optimizing your AWS environment.

About the Authors

Konala McGrath is a Solutions Architect at AWS. He supports SMB customers across all industries and helps them build highly scalable, cost-optimized cloud solutions. He has been with AWS for over 5 years, helping customers migrate and scale their infrastructure on AWS. In his free time, he enjoys spending time with his family, skiing, biking, and watching the 49ers. Konala holds a bachelor’s degree from the University of Washington in Mechanical Engineering and is based in the US.

Dusty Poole is a Solutions Architect at AWS, based out of Texas. He helps SMB customers in the Central US accelerate their adoption of the AWS Cloud by providing architectural guidelines to design innovative and scalable solutions. Outside of work, he loves to fish and support the Buffalo Bills.

Akshaye Nanglia is a Solutions Architect at AWS who supports SMB customers. In his role, he works with customers to build highly scalable, cost-optimized cloud solutions that can be deployed instantly. He holds a master’s degree in Business Analytics from the University of Texas at Dallas and is based out of Texas.

Read MoreAWS Database Blog

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments