tsogtgerel.ts
tsogtgerel.ts

Reputation: 975

AWS rest api with blank Lambda - First response too slow

When API Gateway calls a blank Lambda function, the first response time is 1500ms.

The following response time is 150ms.

Is that normal or is something is wrong?

Upvotes: 0

Views: 344

Answers (1)

ubi
ubi

Reputation: 4399

This is due to Lambda cold start which is normal/expected behaviuor. There are various ways you can improve the cold start

  • Try with a larger memory allocation (note that Lambda cost is proportional to memory and cpu)
  • Try provisioned concurrency

Upvotes: 2

Related Questions