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
posta 10 mesi fa831 visualizzazioni
1 Risposta
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
ESPERTO
con risposta 10 mesi fa
  • 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?

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande