Skip to content

AppSync + Aurora Serverless V2 - The request was throttled because of insufficient resources on the database

0

Hello everyone,

I use Aurora Serverless (with PostgreSQL 13) with Data API in AWS AppSync. Noted that it was working as normal with Aurora Serverless v1. After upgrading to Aurora Serverless V2, I'm getting the "Request restricted due to insufficient resources on the database" issue in some appsync's resolver.

Does anyone know how to address this issue? Many thanks!

asked 2 years ago460 views

1 Answer
0

The issue you're experiencing with Aurora Serverless v2 and AppSync is likely related to the scaling behavior and capacity settings of your Aurora Serverless v2 cluster. Here are some steps you can take to address this problem:

  1. Check your Aurora Serverless v2 capacity settings:

    • Ensure that your minimum and maximum ACU (Aurora Capacity Units) settings are appropriate for your workload.
    • Consider increasing the minimum ACU to handle sudden spikes in workload better.
  2. Monitor your cluster's performance:

    • Use Amazon CloudWatch to track important metrics like ACU usage, connections, and CPU utilization.
    • Look for patterns of resource exhaustion that might be causing the throttling.
  3. Optimize your database parameters:

    • Pay attention to parameters like max_connections. For PostgreSQL 13 on Aurora Serverless v2, if your minimum ACU is set to 0.5, max_connections is capped at 2,000.
    • Be aware that some non-default parameter values might prevent your cluster from scaling down efficiently.
  4. Consider using a connection pooler:

    • Implement Amazon RDS Proxy or pg_bouncer to manage connections more efficiently.
    • This can help reduce memory overhead and potentially lower your ACU usage.
  5. Review your AppSync resolvers:

    • Optimize your queries and mutations to reduce resource consumption.
    • Consider implementing caching strategies where appropriate.
  6. Validate your Data API configuration:

    • Ensure that the Data API is properly enabled and configured for your Aurora Serverless v2 cluster.
    • Test the Data API independently using AWS CLI commands to isolate any issues.
  7. Adjust scaling configuration:

    • If you're experiencing frequent throttling, you might need to increase your maximum ACU limit to allow for higher scaling capacity during peak loads.

By implementing these steps, you should be able to mitigate the throttling issues and optimize your Aurora Serverless v2 performance with AppSync. Remember to monitor your changes closely and adjust as needed based on your specific workload patterns.

Sources
Understanding how certain database parameters impact scaling in Amazon Aurora Serverless v2 | AWS Database Blog
Managing Aurora Serverless v2 DB clusters - Amazon Aurora
Using Aurora PostgreSQL with Data API in AWS AppSync - AWS AppSync
Using Aurora Serverless with AWS AppSync - AWS AppSync

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Hi, as said above, look at 2 key aspects: ACUs and max connections. That's very probably where your issue lies if you've solid traffic on the db. Best, Didier

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.