How to optimize AWS Lambda?

I am currently creating a web API using AWS Lambda with a serviceless map .

In my lambda functions, each of them connects to Redis (elastic) and RDB (Aurora, RDS) or DynamoDB to retrieve data or write new data. And all my lambda functions work in my VPC.

Everything works fine, except that when the lambda function is first executed or is executed for some time after the last execution, it takes quite a lot of time (1-3 seconds) to execute the lambda function, or sometimes it even answers with a gateway timeout error (about 30 seconds) even if my lambda functions are configured to timeout 60 seconds.

As stated in here , I assume 1-3 seconds to initialize a new container. However, I am wondering if there is a way to reduce this time, because 1-3 seconds or the timeout of the gateway is actually not ideal for use in production.

+4
source share
1 answer

You have two problems:

  • 1-3 . Lambda. @Nick , - . Lambda Scheduled Events , , rate(1 minute). , ping, ping, . , , , . .

  • 30 . CloudWatch. , , , 30- -, , Gateway API, Lambda. , , . - AWS. , Lambda - , , , Amazon , .

Lambda Container, , , .

+4

All Articles