AppSync metrics show <50 ms latency while my client's network latency is showing 200-350ms.

0

My client is a React app using @aws-amplify/api running on my local machine. In the browser's dev console "Network" tab, I see graphql queries that take 200-350ms. "Waiting for server response" accounts for >99% of the latency.

In AppSync (us-east-2), I have a lambda function data source that runs <8-10 ms consistently and off of cold starts <60 ms. But even when setting the data source to NoneDatasource (the request data is forwarded immediately to subscribers) I see no difference in the problematic 200-350ms latency. Weirdly, I see the AppSync metrics show that I'm getting a respectable <50 ms latency. I'm not using caching.

Was really hoping AppSync would be a solution for real time data but 350ms is far too high. Is it possible I'm missing something (maybe overhead from the aws-amplify package or from using API key for auth?) or is this normal/expected latency?

Lgg
demandé il y a 2 ans295 vues
1 réponse
0

The difference between the AppSync service level latency and network latency is the time it takes for your client (local browser) to receive a response from AppSync service. I see you are using the us-east-2 region. Is there any other region closer to you? I recommend measuring the network latency against AppSync endpoints. There will always be some network latency depending on where the service sits (AWS AppSync) and where your client is. If clients are located in various geographical locations, you can consider using Route53 and CloudFront to allow latency based routing.

Reference

AWS
Taka_M
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions