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ヶ月前831ビュー
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?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ