Use Case for AWS RDS DB CPU Utilization
Quick Links
- Configure AWS RDS DB CPU Utilization
- Use Case for AWS RDS DB CPU Utilization
- Triage Guides by Violation Type
AWS RDS DB CPU Utilization Policy
Why Use this Policy?
This policy helps you monitor the CPU utilization of your AWS RDS DB instances. By identifying instances with low or high CPU usage, you can optimize resource allocation, reduce costs, and maintain system reliability.
Pros and Cons
Pros:
- Identifies under-utilized databases that may be over-provisioned and costing more than necessary.
- Highlights over-utilized databases that may require resizing to improve performance.
- Supports cost optimization and reliability improvements.
Cons:
- Requires manual intervention to resize or reconfigure databases based on the observations.
- Not suitable for applications with highly variable CPU usage patterns that might not fit well within static thresholds.
How the Policy Works
The policy observes the average CPU utilization of a specified RDS DB instance over the past 30 days. It collects data from AWS CloudWatch and calculates the average maximum CPU utilization over this period.
Variables:
rds_db_instance_avg_cpu_utilization_high
: The average CPU utilization required for DB instances to be considered frequently used. Default is50
.rds_db_instance_avg_cpu_utilization_low
: The average CPU utilization required for DB instances to be considered infrequently used. Default is25
.
Violation Types
- HIGH_CPU_UTILIZATION: When the observed average CPU utilization exceeds the high threshold.
- LOW_CPU_UTILIZATION: When the observed average CPU utilization falls below the low threshold.
Implementation
The policy consists of two parts:
- Policy Function: Gathers data from AWS CloudWatch, calculates the needed metrics, and formats the observance.
- Policy Expression: Evaluates the observance against the provided thresholds, and generates the appropriate violations.