How can I create CloudWatch alarms to monitor the Amazon RDS free storage space and prevent storage full issues?
Last updated: 2020-12-03
My Amazon Relational Database Service (Amazon RDS) DB instance is in a STORAGE_FULL state, and the DB instance is hanging. How can I monitor the available storage space for my DB instance to avoid running out of storage?
Create alarms in the Amazon CloudWatch console or use the AWS Command Line Interface (AWS CLI) to create alarms that monitor free storage space. By creating CloudWatch alarms that notify you when the FreeStorageSpace metric reaches a defined threshold, you can prevent storage full issues. This can prevent downtime that occurs when your RDS DB instance runs out of storage.
Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.
- Open the CloudWatch console, and choose Alarms from the navigation pane.
- Choose Create alarm, and choose Select metric.
- From the All metrics tab, choose RDS.
- Choose Per-Database Metrics.
- Search for the FreeStorageSpace metric.
- For the instance that you want to monitor, choose the DB instance Identifier FreeStorageSpace metric.
- In the Conditions section, configure the threshold. For example, choose Lower/Equal, and then specify the threshold value.
Note: You must specify the value for the parameter in bytes. For example, 10 GB is 10737418240 bytes.
- Choose Next.
- From the Configure actions page, for the alarm state, choose in Alarm.
- From Select an SNS topic, choose Create new topic.
- Enter the topic name, for example, rds-storage-alarm.
- For Email endpoints that will receive the notification, enter your email address.
- Choose Create topic. This sends a confirmation email to the address that you specified.
- Open the email notification that you received from AWS Notifications, and then choose Confirm subscription.
- Return to the Configure actions page in the CloudWatch console.
- Choose Next.
- Enter a name and description for your alarm, and choose Next.
- Review the preview of your metric, and choose Create alarm.
After you create the alarm, open the Amazon RDS console, and then choose Databases from the navigation pane. Choose the name of your database, and then choose the Monitoring tab to view the metrics for FreeStorageSpace.
It's also a best practice to create a second, critical alarm for a lower threshold. For example, you might set your first alarm for 25 GB, and the second, critical alarm to 10 GB.
You can also prevent storage full issues by using the following methods:
- Subscribe to an Amazon RDS event notification for RDS-EVENT-0089 and RDS-EVENT-0007 to receive notifications when storage is low.
- Monitor the FreeStorageSpace metric.
- Use Amazon RDS storage autoscaling to manage your capacity.
For more methods for avoiding storage full issues, see Monitoring Amazon RDS. If your RDS DB instance storage is already full, see How do I resolve problems that occur when Amazon RDS DB instances run out of storage?