AWS Certified Developer – Associate (DVA-C02)Troubleshooting and MonitoringMedium

A developer is observing high latency for an AWS Elastic Beanstalk application. The application logs show that requests are frequently waiting for available database connections. The database (Amazon RDS) metrics indicate high CPU utilization and a large number of active connections. Scaling up the Elastic Beanstalk environment's EC2 instances has not resolved the issue. What is the MOST effective immediate action to reduce application latency?

  1. AIncrease the maximum number of database connections allowed by the RDS instance.
  2. BEnable read replicas for the Amazon RDS instance to offload read traffic.
  3. CScale up the Amazon RDS instance type to a larger class with more resources.
  4. DImplement a connection pooling library within the application code.
Show answer & explanation

Correct answer: C. Scale up the Amazon RDS instance type to a larger class with more resources.

The problem indicates that the RDS instance has high CPU and a large number of active connections, and application requests are waiting for connections. This points to the database being the bottleneck. Scaling up the RDS instance type (vertical scaling) provides more CPU, memory, and potentially better I/O, directly addressing the resource contention and improving its ability to handle active connections and queries.

Why the other options are wrong

  • A. Increasing the maximum connections might allow more connections, but if the database CPU is already high, it will only exacerbate the problem by allowing more work against an overwhelmed CPU, leading to slower query processing.
  • B. Read replicas offload read traffic, which is beneficial for read-heavy workloads. While helpful for long-term scaling, the immediate problem described (high CPU, many active connections, requests waiting for connections) points to overall database capacity, which a read replica might not immediately solve if write operations are the bottleneck or if all connections are hitting the primary.
  • D. Connection pooling is a good practice for efficiency, but it won't solve an *already overwhelmed* database with high CPU. It manages *how* connections are used, not the database's capacity to process queries.

RDS Vertical Scaling

Vertical scaling (scaling up) for Amazon RDS involves changing the instance type to one with more CPU, memory, and/or I/O capacity, directly increasing its processing power.

  • Addresses bottlenecks due to insufficient compute/memory.
  • Requires a brief outage during the instance type change.
  • Different from horizontal scaling (read replicas, sharding).

Memory trick: When RDS groans, give it more muscle or fewer tasks.

More Troubleshooting and Monitoring questions