Low Performance AWS Lamba Using RDS

I implemented the AWS Lambda feature using the Serverless Framework. This Lambda feature uses RDS and MongoDB. The MongoDB endpoint runs for about 500 ms, but RDS runs for 12 seconds (cold start) and ~ 3 sec (hot start).

Note. I am using Sequelize at this endpoint.

How to speed up my RDS Lambda endpoint?

+6
source share
2 answers

In the first line after defining your function module, add the following line

context.callbackWaitsForEmptyEventLoop = false;

callbackWaitsForEmptyEventLoop

  • The default value is true.
  • .

false, AWS Lambda, callback, . AWS Lambda , Node.js( , Lambda , AWS Lambda )

this article

+8

context.done context.succeed/context.fail. - Node 4.

, Lambda, (, Gateway API) , , 15 .

: , setTimeout, ~ 15 , Lambda .

0

Source: https://habr.com/ru/post/1015048/


All Articles