Investigating and Preventing Unexpected AWS AppSync Cost Spike in Staging Environment

0

Hello AWS Community,

I recently encountered a significant spike in billing costs associated with AWS AppSync, specifically in my staging environment for a React-based website project. After a detailed review, including input from the AWS technical team, it was identified that the spike was due to unusually high traffic of request counts (16,368,616) targeting specific fields in my GraphQL schema. Here are the specifics:

The Query.getTeam field was resolved 3 times. The Team.players field was resolved 2 times. These unique combinations were invoked excessively. The None resolver was invoked 3 times, and the DDB (DynamoDB) resolver was invoked 2 times. This pattern of access is unexpected and not aligned with our typical website usage or behavior. I have spent hours checking our web pages, and none seemed to be causing unexpected refreshes or data requests that could lead to this behavior.

Questions for the Community:

Investigation Tips: How can I further investigate to pinpoint which page or component in my React application might be causing these excessive requests to AppSync?

Preventive Measures: What strategies or practices can you recommend to prevent such unexpected behavior in the future? Are there specific monitoring tools or AWS services that could help identify and alert on unusual patterns before they result in significant costs?

Rate Limiting on AppSync: Is it possible to implement rate limiting directly on AWS AppSync to control the number of requests a client can make within a given timeframe, thus preventing potential abuse or unexpected costs?

Optimization Suggestions: Any advice on optimizing GraphQL queries or using AppSync and DynamoDB more efficiently to avoid similar issues?

Any insights, advice, or resources you could share would be greatly appreciated. I'm looking to understand this issue more deeply to prevent recurrence and manage AWS costs more effectively.

Appsync monitoring

Thank you in advance for your help!

No Answers

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.

Guidelines for Answering Questions