[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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南