Latency issues with AppSync

0

WE are using Appsync mutations and subscription as pass though with none as data source and seeing mutation on avg taking more them 500 ms for a "NONE" data source with out any lambda and authorizer is also cached so latency on auth

  • Hi Srikanth,

    Were you able to find and address the root-cause of the latency issue?

asked 8 months ago607 views
1 Answer
0

Latency issues in AWS AppSync can be caused by a variety of factors. While you've mentioned that you are using "NONE" as a data source and that the authorizer is cached, there are still several areas to investigate in order to diagnose and potentially address the latency you're experiencing. Here are some steps you can take:

  1. Query Complexity: Check the complexity of your GraphQL queries and mutations. Complex queries can lead to increased processing time. AWS AppSync provides tools to analyze query complexity, and you can set query depth and complexity limits in the schema definition to help control this.

  2. Resolver Logic: Review the resolver logic associated with your mutations. Even though you're using a "NONE" data source, if your resolver contains complex logic or multiple actions, it can contribute to latency. Optimize your resolver code for efficiency.

  3. Subscription Setup: While you mentioned that you are using subscriptions as pass-through, it's important to ensure that your subscription resolvers are set up correctly. A misconfigured subscription resolver could lead to latency. Double-check that you're using the correct subscription mapping templates.

  4. Authorizer Configuration: Although you mentioned that the authorizer is cached, ensure that the caching mechanism is functioning as expected. Caching can significantly improve response times, so any issues with caching can impact latency.

  5. Network Latency: Network latency can also contribute to the overall latency you're experiencing. If your AppSync endpoint and resources (databases, other AWS services, etc.) are located in different regions, this can lead to increased network latency. Check if any of your resources are in a different region than your AppSync endpoint.

  6. Monitoring and Logging: Utilize AWS CloudWatch to monitor the performance of your AppSync APIs. CloudWatch logs and metrics can provide insights into the execution times of your resolvers and other parts of your AppSync infrastructure.

  7. Amazon DynamoDB: If your "NONE" resolvers are interacting with Amazon DynamoDB (even though you haven't mentioned it), consider reviewing the performance of your DynamoDB tables, indexes, and the queries you're executing.

  8. Cold Starts: Even if you're not using Lambdas as data sources, if you have other AWS services integrated into your AppSync setup, be aware of potential "cold start" issues that could introduce latency. This is more relevant if you're using Lambda functions.

  9. Load Testing: Perform load testing on your AppSync API to see how it performs under various levels of traffic. This can help you identify potential bottlenecks and areas that need optimization.

  10. AWS Support: If you've gone through these steps and the latency persists, consider reaching out to AWS Support for more personalized assistance. They can provide guidance based on your specific use case and configuration.

Remember that AWS services, including AppSync, are highly configurable, and optimizing for performance often requires a thorough understanding of the services and how they interact. Regular monitoring and continuous optimization can help you maintain a high-performing AppSync API.

profile picture
answered 8 months ago

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