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


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 Answer
Accepted Answer

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
answered 2 years ago
  • Hi Uri, i found my problem. It's because of my region & network issues. Thanks for replying

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions