[API Gateway] Why is the actual response time so large

0

Hi everyone, I just have a test by setting up API Gateway + Lambda to check the response time. After finished i found a strange point after using X-Ray to trace the response time of API

My curious is:

1/ Why the response time so different ?

2/ How can i decrease the response time of browser or postman under 100ms even just with very simple testing infrastructure (AGW + Lambda) ?

p/s: i've enable API Gateway caching and thanks for your time

  • The photos below of X-Ray

Response time : 6~8ms Enter image description here Enter image description here

  • The photos below of Browser & Postman

Response time: ~ 200ms Enter image description here Enter image description here

1 回答
0
已接受的回答

I am guessing that what you are seeing is a Lambda cold start, i.e., you are invoking the function for the first time after some idle time. To verify, go to the Lambda logs and check if re REPORT line includes "Initialization Duration".

profile pictureAWS
专家
Uri
已回答 2 年前
  • Hi Uri, i found my problem. It's because of my region & network issues. Thanks for replying

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则