DOP-C02 Question 120
Select 2You are a DevOps engineer managing a microservices application deployed on Amazon ECS with Fargate. The application uses an Amazon RDS PostgreSQL database in the backend. The application has been experiencing intermittent connection issues, and logs indicate that the problem is due to exhausted database connections. Which of the following actions should you take to address the issue effectively?
- A
Enable Amazon RDS Proxy to manage database connections between the application and the database.
- B
Increase the max_connections parameter of the PostgreSQL database in the Amazon RDS instance.
- C
Implement connection pooling in the application layer to reuse database connections.
- D
Increase the number of Fargate tasks running in the ECS service.
- E
Enable Multi-AZ deployment for the Amazon RDS instance to improve availability.
Show answer and explanation
Correct answers: A, C
Explanation
The issue is caused by exhausted database connections. Amazon RDS Proxy and connection pooling at the application layer are the most effective solutions for managing and reusing database connections, reducing the likelihood of exhaustion. Increasing the max_connections parameter is another option that can help, but it should be used cautiously. Adding more ECS tasks or enabling Multi-AZ deployment does not directly solve the problem of connection exhaustion.
- A. Correct.
Correct: Amazon RDS Proxy helps manage database connections efficiently by pooling and reusing connections, thus preventing exhaustion of database connections.
- B. Incorrect.
Correct: Increasing the max_connections parameter allows the database to handle more simultaneous connections, which can mitigate exhaustion issues. However, this should be done with caution to avoid resource contention.
- C. Correct.
Correct: Implementing connection pooling at the application level optimizes database resource usage by reusing existing connections rather than creating new ones for every request.
- D. Incorrect.
Incorrect: Increasing the number of ECS Fargate tasks may exacerbate the problem by creating more connections to the database, further exhausting its connection limit.
- E. Incorrect.
Incorrect: While Multi-AZ deployment improves database availability and failover capabilities, it does not address connection exhaustion issues.