> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoring RDS Metrics for database performance optimization

> Overview of monitoring Amazon RDS metrics to detect bottlenecks and optimize database performance via query tuning, scaling, connection pooling, and AWS monitoring tools

Welcome — this lesson covers the core Amazon RDS metrics to monitor for diagnosing and optimizing database performance. These high-level metrics expose common bottlenecks and guide decisions around tuning, scaling, or re-architecting your database layer.

## Key metrics and what they indicate

### CPU utilization

Monitor the percentage of CPU used by your RDS instance. Sustained high CPU usually signals heavy read/write activity or inefficient queries.

* What to check:
  * Query patterns and slow queries.
  * Index usage and full table scans.
  * Background tasks such as backups or maintenance.
* Scaling guidance:
  * Vertical scaling (larger instance) is commonly required for write-heavy workloads.
  * Horizontal scaling (read replicas) is effective when reads dominate.
  * Always profile and optimize queries before resizing; inefficient SQL can consume CPU even on larger instances.

<Callout icon="warning" color="#FF6B6B">
  Before vertical scaling, profile slow queries and confirm that CPU is the real bottleneck. Increasing CPU without fixing inefficient queries can be costly and temporary.
</Callout>

### Database connections

Track the total number of open connections. A sudden rise or sustained high count can indicate missing connection pooling, app misconfiguration, or too many clients.

* Solutions:
  * Implement connection pooling in the application.
  * Use RDS Proxy to multiplex client connections and maintain a controlled pool of persistent DB connections.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/8AbhOfHK1jf6YcM9/images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/rds-database-open-connections-app.jpg?fit=max&auto=format&n=8AbhOfHK1jf6YcM9&q=85&s=f57cac8bec0bfccad517bc4c3e00fbe1" alt="A diagram titled &#x22;Database Connections&#x22; showing Amazon RDS on the left, a stacked-disk database icon in the center, and an application box on the right. It illustrates tracking the number of open connections between the application and the database." width="1920" height="1080" data-path="images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/rds-database-open-connections-app.jpg" />
</Frame>

RDS Proxy is an add-on service that sits in front of your RDS instance and maintains a configured number of persistent connections to the database. It reduces connection churn, improves application scalability, and mitigates connection storms. See the RDS Proxy docs: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html)

### Freeable memory

Freeable memory is the RAM available on the DB instance. Low freeable memory often correlates with degraded performance (e.g., increased swapping, evictions from caches).

* If memory is low:
  * Consider vertical scaling to a larger instance type with more RAM.
  * Offload read-heavy workloads to read replicas so the primary’s memory is less pressured.
  * Re-evaluate indexing and caching strategies so working sets fit in memory.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/8AbhOfHK1jf6YcM9/images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/freeable-memory-amazon-rds-ram-warning.jpg?fit=max&auto=format&n=8AbhOfHK1jf6YcM9&q=85&s=fb1d06b8c0be1bb92e01bd315b141b0e" alt="A slide titled &#x22;Freeable Memory&#x22; showing an Amazon RDS icon on the left and a stylized RAM/chip and database icon on the right. It explains that freeable memory is the amount of RAM the instance can use and notes &#x22;Low memory → Poor performance.&#x22;" width="1920" height="1080" data-path="images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/freeable-memory-amazon-rds-ram-warning.jpg" />
</Frame>

### I/O metrics (Read/Write IOPS and latency)

Key I/O metrics are ReadIOPS, WriteIOPS, ReadLatency, and WriteLatency. They show how active and responsive your storage layer is.

* High read latency: consider read replicas, caching (Redis/Memcached), or query/index optimization.
* High write latency: consider higher-throughput storage (Provisioned IOPS), larger instance types, or batching writes where possible.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/8AbhOfHK1jf6YcM9/images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/write-latency-app-to-rds-diagram.jpg?fit=max&auto=format&n=8AbhOfHK1jf6YcM9&q=85&s=26174fb684e8c4d4e2448f19bdbefc2c" alt="A diagram titled &#x22;Write Latency&#x22; showing a code/application icon on the left sending write operations (arrow with a stopwatch) to an Amazon Relational Database Service (Amazon RDS) icon on the right." width="1920" height="1080" data-path="images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/write-latency-app-to-rds-diagram.jpg" />
</Frame>

### Disk queue depth

DiskQueueDepth measures the number of pending I/O operations waiting for the disk. A sustained high queue depth indicates the disk cannot keep up with demand.

* Remediation steps:
  * Increase IOPS or switch to higher-performance volume types (Provisioned IOPS, io2).
  * Increase instance size if the workload requires more CPU/memory to process IO.
  * Offload reads to replicas or a cache to reduce IO pressure on the primary.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/8AbhOfHK1jf6YcM9/images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/disk-queue-depth-app-requests-rds.jpg?fit=max&auto=format&n=8AbhOfHK1jf6YcM9&q=85&s=761a62949a2313b504c361f066c39c03" alt="A diagram titled &#x22;Disk Queue Depth&#x22; showing an application icon on the left sending multiple read/write requests that sit in a disk queue, then are processed by Amazon Relational Database Service (RDS) on the right." width="1920" height="1080" data-path="images/AWS-Certified-CloudOps-Engineer-Associate/Domain-1-Monitoring-Logging-and-Remediation/Monitoring-RDS-Metrics-for-database-performance-optimization/disk-queue-depth-app-requests-rds.jpg" />
</Frame>

## Quick reference table

| Metric | What it reveals | Typical remediation |
| - | - | - |
| CPUUtilization | Compute pressure (queries, background tasks) | Profile/optimize queries, scale instance |
| DatabaseConnections | Number of open client connections | Add pooling, use `RDS Proxy` |
| FreeableMemory | Available RAM for caches/indexes | Increase instance memory, use replicas |
| ReadIOPS / WriteIOPS | Storage operation rate | Increase IOPS, use faster storage |
| ReadLatency / WriteLatency | Storage responsiveness | Offload reads, tune queries, upgrade storage |
| DiskQueueDepth | Pending IO operations | Increase throughput, use replicas/caching |

## Monitoring tools and deeper visibility

* Use Amazon CloudWatch to collect and alert on: `CPUUtilization`, `DatabaseConnections`, `FreeableMemory`, `ReadIOPS`, `WriteIOPS`, `ReadLatency`, `WriteLatency`, and `DiskQueueDepth`. (CloudWatch docs: [https://learn.kodekloud.com/user/courses/aws-cloudwatch](https://learn.kodekloud.com/user/courses/aws-cloudwatch))
* Enable Enhanced Monitoring to get OS-level metrics: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER\_Monitoring.OS.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html)
* Enable Performance Insights for query-level visibility and top wait events: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER\_PerfInsights.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html)

<Callout icon="lightbulb" color="#1CB2FE">
  Monitor related metrics together. Example: high CPU with low DiskQueueDepth implies compute-bound issues (optimize queries or scale CPU), while high DiskQueueDepth with high latency indicates a storage bottleneck (increase IOPS or offload reads).
</Callout>

## Best practices summary

* Profile and optimize slow queries and indexing before scaling.
* Use connection pooling and RDS Proxy to manage connection storms.
* Offload read traffic to read replicas or caches to reduce primary load.
* Pick the right storage class (Provisioned IOPS / io2) for write-heavy, latency-sensitive workloads.
* Combine CloudWatch alarms, Enhanced Monitoring, and Performance Insights for comprehensive diagnostics.

## Links and references

* Amazon RDS Overview: [https://learn.kodekloud.com/user/courses/aws-rds](https://learn.kodekloud.com/user/courses/aws-rds)
* RDS Proxy: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html)
* Read replicas: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER\_ReadRepl.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html)
* RDS Storage and PIOPS: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP\_Storage.html#USER\_PIOPS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS)
* EBS volume types (io2): [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#io2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#io2)
* Enhanced Monitoring: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER\_Monitoring.OS.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html)
* Performance Insights: [https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER\_PerfInsights.html](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html)

These metrics and practices will help you detect bottlenecks early and choose the most effective tuning or scaling approach for Amazon RDS-based databases.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/aws-certified-sysops-administrator-associate/module/e7f728df-5d8d-4dbb-80f6-33c15cde3034/lesson/a526a012-dc7c-4545-8c4e-eb586de38bdb" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.