A company runs a critical application on Amazon RDS for PostgreSQL. The database experiences periodic slowdowns. The team wants to monitor the number of active connections and the query execution time. Which approach is most cost-effective?
Performance Insights exposes the DBLoad metric, which represents the average number of active sessions and directly reflects query execution workload, and it can be streamed to CloudWatch for alarm creation. Per-query execution time is visible through the top SQL dashboard, allowing you to correlate load spikes with specific queries. The basic retention is included with RDS at no additional cost, making this a cost-effective and fully managed solution for monitoring query performance.
Why this answer
Performance Insights provides detailed query execution time metrics, enabling monitoring of query performance. It also includes the 'DBLoad' metric which reflects database load from active connections and queries. Combined with CloudWatch alarms, this approach is cost-effective as Performance Insights is included with RDS at no additional cost for up to 7 days of retention (longer retention has a fee).
Options A and B are invalid because the CloudWatch agent cannot be installed on RDS instances, and 'QueryExecutionTime' is not a standard CloudWatch metric for RDS. Option D is less suitable for the specific requirement of query execution time; Enhanced Monitoring provides OS-level metrics like processes and memory but does not track query-level execution time.
Exam trap
Candidates often assume Enhanced Monitoring is the most cost-effective because it is free, but it lacks query-level performance data. The key is that Performance Insights tracks execution time natively and is included at no extra cost for the first 7 days, making it the correct choice for this requirement.
How to eliminate wrong answers
Option A is wrong because the CloudWatch agent cannot be installed on an RDS instance; RDS is a managed service and does not allow direct OS access or agent installation. Option B is wrong because 'QueryExecutionTime' is not a standard metric available in the RDS console; the console provides 'DatabaseConnections' but not query execution time. Option C is wrong because Performance Insights focuses on database load (DBLoad) and query performance analysis, but it does not directly expose the number of active connections as a metric for CloudWatch alarms; additionally, enabling Performance Insights incurs extra costs beyond the basic RDS pricing.