Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js 18.x. Longer cold starts than prior versions (16, 14, 12) #83

Closed
o-alexandrov opened this issue Mar 21, 2023 · 5 comments
Closed

Comments

@o-alexandrov
Copy link

o-alexandrov commented Mar 21, 2023

Based on @jtuliani comment from Nov 2022, AWS is aware of the longer cold starts:

We're aware of the reports of longer cold starts on Node 18 and we're investigating the issue. We'll report back once those investigations are complete.

And then again from @jtuliani on Feb 9, 2023:

We have identified the primary cause of the longer cold starts in the Node 18 runtime as thread blocking in a dependency used during initialization. We are evaluating options to resolve this in a future Node 18 runtime update.

@maxday created a Cold Start dashboard:

10 Cold Starts for each runtime, updated daily

Using @maxday's dashboard, you could quickly verify the cold starts issue has not been resolved.

As mentioned by @ffxsam in this comment, the issue might be related to the slower aws-sdk v3 described in this article.

  • prior node.js versions included aws-sdk v2, which according to the article above leads to faster cold starts than v3
@o-alexandrov o-alexandrov changed the title Node.js v18. Longer cold starts than prior versions (16, 14, ...) Node.js 18.x. Longer cold starts than prior versions (16, 14, 12) Mar 21, 2023
@bicatu
Copy link

bicatu commented Mar 24, 2023

Hi @jtuliani is there a ticket we can follow to track the progress of this issue?
I am holding the migration to node18 of some services and it would be nice to know when to resume.

@jtuliani
Copy link

Thank you @o-alexandrov for filing this issue to track cold start performance improvements in the Lambda Node.js 18 runtime. We have identified several potential performance optimizations which we are evaluating and testing. We will provide updates via this issue once they are rolled out.

@aldex32
Copy link

aldex32 commented May 30, 2023

Hi @jtuliani any update please?

@o-alexandrov
Copy link
Author

o-alexandrov commented May 30, 2023

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.

@jtuliani
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants