- Newest
- Most votes
- Most comments
The issue you're experiencing with the Data API for Aurora Serverless v2 and MySQL 8.0.36 appears to be related to connection management and resource allocation. The Data API has been redesigned for Aurora Serverless v2 to improve scalability and remove the previous 1,000 requests per second limit. However, it seems that in your case, the connections are not being managed as efficiently as expected.
The "Too Many Connections" error you're encountering suggests that the Data API is creating new connections for each query rather than effectively reusing existing connections from the connection pool. This behavior is contrary to the intended design of the Data API, which should automatically pool and share database connections to improve application scalability.
The fact that you're seeing a large number of sleeping connections in the process list indicates that connections are being created but not properly closed or reused. This can quickly exhaust the available connection limit, leading to the errors you're experiencing.
The throttling error ("The request was throttled because of insufficient resources on the database") is likely a result of the database reaching its maximum connection limit or other resource constraints.
To troubleshoot and potentially resolve this issue, consider the following steps:
-
Verify that you're using the latest version of the AWS SDK and CLI, as there may have been updates to address connection management issues.
-
Review your application code to ensure you're not inadvertently creating new connections for each query. The Data API should handle this automatically, but it's worth double-checking.
-
Consider increasing the maximum ACUs for your Aurora Serverless v2 cluster temporarily to see if it alleviates the issue. This could provide more resources for handling connections.
-
Contact AWS Support for further assistance, as this behavior seems to be inconsistent with the expected performance of the redesigned Data API for Aurora Serverless v2.
-
Monitor the CloudWatch metrics for your database cluster closely, paying attention to connection counts, CPU utilization, and memory usage to identify any potential resource bottlenecks.
-
If possible, try to reproduce the issue with a simpler query structure to isolate whether the problem is specific to nested resolvers or a more general connection management issue.
-
Consider implementing a retry mechanism with exponential backoff in your application to handle temporary connection issues.
If these steps don't resolve the issue, it may be worth considering alternative approaches, such as using a traditional database driver with a properly configured connection pool, at least until the Data API behavior can be fully resolved.
It's important to note that while Aurora Serverless v2 and the redesigned Data API offer improvements over v1, they may still have some limitations or issues that are being addressed. Continuing to work with AWS Support and providing detailed feedback about your use case can help improve the service for all users.
Sources
Introducing the Data API for Amazon Aurora Serverless v2 and Amazon Aurora provisioned clusters | AWS Database Blog
Amazon Aurora MySQL now supports RDS Data API - AWS
Amazon Aurora PostgreSQL now supports RDS Data API
Relevant content
- asked 2 years ago
- asked a month ago
- asked 2 years ago
- asked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 15 days ago
- AWS OFFICIALUpdated 3 years ago
The gist is exactly in this paragraph: