400 ms difference between APIG latency and Lambda Latency

0

We have a Lambda with multiple functions fronted by an APIG. We expect that the APIG latency for a specific lambda endpoint (resource) should be very close to the p50 latency reported by the lambda for that endpoint.

However we consistently see a ~400 ms difference between the APIG latency and the various latencies for each lambda function behind the APIG.

Two questions:

  1. What could be causing this and how can I test for this?

  2. One hypothesis was that it might be due to SSL. I expect that SSL would only add 100 ms not 400 ms. That being said how can I confirm if the is SSL between the APIG and the Lambda, and if there is how much latency that is adding?

1개 답변
0
수락된 답변

There are a number of possible factors so I won't try to guess on what the cause would be. I'd recommend utilizing X-Ray tracing on API Gateway and your lambdas. This will give you insight into where the time is being spent and some hints as to what might be going on.

Some resources to get started on getting AWS X-Ray integrated:

Amazon API Gateway active tracing support

AWS Lambda and AWS X-Ray

AWS
답변함 4년 전
  • I don't feel like this answers the question. The scenario is pretty simple, and I have yet to get a clear answer on this. I have an API Gateway and an AppSync API both in the same region, both with the same Lambda functions hooked to them, both with requests coming from the same place. API Gateway is always significantly faster. I really want to use AppSync, but the performance is unacceptably slow.

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

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

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

관련 콘텐츠