AWS Developer DVA-C02 · Troubleshooting and Optimization · medium
Hundreds of short-lived AWS Lambda functions concurrently open and close new TCP database connections to an Amazon RDS for PostgreSQL instance during traffic bursts, exhausting the database's max_connections memory limit and causing Too many connections errors. Which fully managed AWS service sits between Lambda and Amazon RDS to pool and share warm database connections while speeding up Multi-AZ failover times?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: B. Amazon RDS Proxy managing a shared pool of warm database connections
Amazon RDS Proxy is the fully managed service designed for this exact problem. Each Lambda execution environment normally opens its own database connection, so a burst of hundreds of concurrent invocations can exceed max_connections on the RDS for PostgreSQL instance and produce Too many connections errors. RDS Proxy sits between the function and the database, keeps a pool of established connections, and multiplexes many client connections onto a smaller number of database connections, which protects database memory and CPU. It also shortens Multi-AZ failover impact, because the proxy keeps client connections open and routes to the new primary instead of making every client re-resolve DNS and reconnect. Lambda must be configured to connect to the proxy endpoint instead of the instance endpoint, and the function typically runs in the same VPC. The common trap is picking a caching or networking product because it sounds like it improves performance, when the real issue is connection management for a relational database.
Why the other options are wrong
- A. Amazon DynamoDB Accelerator (DAX) in-memory NoSQL cluster read cache — DAX is an in-memory read cache that works only with Amazon DynamoDB and its API. It does nothing for PostgreSQL on RDS and does not pool or manage TCP database connections.
- C. AWS Direct Connect dedicated physical fiber link to the RDS VPC subnet — AWS Direct Connect is a dedicated private network link between an on-premises site and AWS. It changes how traffic reaches AWS but does not pool connections or limit how many Lambda functions open connections to the database.
- D. Amazon S3 Transfer Acceleration global CloudFront edge network endpoints — S3 Transfer Acceleration speeds up long-distance uploads and downloads to Amazon S3 buckets using CloudFront edge locations. It has no connection with relational database connections or RDS failover.
More Troubleshooting and Optimization questions
- A backend application uses Amazon ElastiCache for Redis in front of an Amazon RDS PostgreSQL database. Whenever the…
- A developer wants their AWS Lambda function to emit custom business metrics (OrderValue, CheckoutLatencyMs) alongside…
- An AWS Lambda function processes CPU-intensive image resizing and takes 4,000 ms (4.0 seconds) when configured with…
- An Amazon SQS standard queue has its default VisibilityTimeout set to 30 seconds. A worker EC2 instance polls the…
- A developer instruments a microservices payment API with the AWS X-Ray SDK. They want to attach custom key-value data…
All Troubleshooting and Optimization questions and the topic overview →
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.