title: What is the cause of a cold start latency in AWS Lambda?
body: <p>I have a Lambda function written in Java which is being accessed from API Gateway.
  In cold start scenarios, the actual code is taking 1.5 secs to complete execution(Verified from Cloudwatch Logs) but it's taking more than 10 secs to get the final response in API Gateway. It's annoying.</p>
  
  <p>I have captured the X-Ray tracers for both Cold start and Hot start scenarios.</p>
  
  <p>Can anyone help me in resolving this performance issue ?</p>
  
  <p>Cold Start:
  <a href="https://i.stack.imgur.com/LIbwt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LIbwt.jpg" alt="Cold Start"></a></p>
  
  <p>Hot Start:
  <a href="https://i.stack.imgur.com/DUfwQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DUfwQ.jpg" alt="Hot Start"></a></p>