Improving cold start times #115
-
Hey @metaskills, It's been a while, but thanks for your continued work on this! At my company, we're pretty interested in seeing if we can make our production app work on lambda. The trouble I'm running into is the cold start time (classic, right?). I'm hovering at ~21-23s with Bootsnap enabled, which for a website is obviously terrible. I broke out the entire cold start sequence into a huge, terrible script and then attached a bunch of puts w/ the CloudWatch logs timestamps only showing the seconds. Some Notes
High Level Timings
Things I've Tried From the Cold Start guide:
I'm aware of provisioned concurrency and keep warm Any recommendations, tips? Thanks again! =========================
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Pro move! Love me some puts :)
Yup, the whole init phase has a timeout of 10s. What is likely happening is that "Function init" phase is being called twice because the first one timed out. The second time is faster because files have already been required, etc. I've seen this before in some edge cases in our functions but it happened so infrequently given our apps init ~3-5s. Some helpful links here on the topics.
Maybe start with these?
|
Beta Was this translation helpful? Give feedback.
Pro move! Love me some puts :)
Yup, the whole init phase has a timeout of 10s. What is likely happening is that "Function init" phase is being called twice because the first one timed out. The second time is faster because files have already been required, etc. I've seen this before in some edge cases in our functions but it happened so infrequently given our apps init ~3-5s. Some helpful links here on the topics.