Drastically increased cold start times between Node 16 and Node 18 in Lambda

0

I have a Lambda written in Typescript using AWS SDK v3. This lambda uses Secrets Manager and DynamoDB. The SDK modules are bundled with code and it is minified. It is running on the x86-64 architecture.

I am seeing a much larger difference in cold start times between Node 16 and Node 18 than I would expect. When deploying the identical code to Node 16 I see a cold start average of around 460ms and with Node 18 it jumps to 560ms. Looking at benchmarks provided by https://maxday.github.io/lambda-perf/ I would expect an increase of 15-20ms, not 100ms.

Is this an expected level performance degradation with Node 18 lambdas?

Austin
已提问 10 个月前829 查看次数
1 回答
0

Hi,

this issue is a known one: https://github.com/aws/aws-lambda-base-images/issues/83

It seems to have been recently resolved:

While everyone is pinged, it's good to note that cold starts in node.js 18 
AWS-managed runtimes have been greatly reduced.
For node.js 18, you can see archive.org on Feb 1, 2023, cold starts were: 219.719ms
And today, May 30, 2023: 173.99ms.

That's more than 20% decrease, which is huge, thank you @jtuliani and the rest of AWS.

==========

Thank you for noticing @o-alexandrov :)

Yes, we have deployed updates to the AWS Lambda Node.js18 runtime which bring
 the cold start times close to the performance with Node.js 16. We are continuing 
to investigate further optimizations. To reduce the risk of backward compatibility issues, 
any further optimizations will be focused on Node 20 rather than being back-ported to 
existing runtimes.

Therefore, closing this item.

Best,

Didier

profile pictureAWS
专家
已回答 10 个月前
  • I saw that issue and it does not match my observations from the beginning of August. Maybe "cold start times close to the performance with Node.js 16" means more of a difference than I would think?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则