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
질문됨 2년 전295회 조회
1개 답변
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠