https://serverless-stack.com/ logo
#sst
Title
# sst
s

Samir Baid

12/30/2021, 4:41 PM
Hey guys, with SST lambda cold start (in debug mode) takes too much time... Is there a plugin like serverless-optimize available for SST?
t

thdxr

12/30/2021, 4:44 PM
By debug mode do you mean you're attaching vscode debugger? Or just running in local mode
d

Derek Kershner

12/30/2021, 4:45 PM
I believe this is built in, it just uses ESBuild instead of Babel. You can just set
minify
to
true
. Basing this answer on https://github.com/serverless/serverless-optimizer-plugin
s

Samir Baid

12/30/2021, 4:50 PM
@Derek Kershner Thanks... Lemme try that.
@thdxr, local mode
t

thdxr

12/30/2021, 4:51 PM
And is it slow on the first invocation and faster after? Or just slow always
s

Samir Baid

12/30/2021, 9:44 PM
it is slow in the first invocation and then faster after...
minify is defaulted to true. I am just building the notes demo app and running it in local mode. The first time i launch it takes > 15 sec. Any suggestions? @thdxr, @Derek Kershner?
d

Derek Kershner

12/30/2021, 9:53 PM
Dax is likely to ask how big your lambda is.
t

thdxr

12/30/2021, 9:55 PM
^ yes haha but if it's just the notes app it should be normal. Hmm can you send me you .build/debug log
d

Derek Kershner

12/30/2021, 9:59 PM
@Samir Baid, are you on the newest version? I had a similar symptom a few versions ago.
s

Samir Baid

12/31/2021, 2:32 AM
@Derek Kershner i am using cli version 0.54.4
i dont know what happened, but i deleted the entire stack (had to delete dynamoDB and S3 manually) and redeployed. Now things look much better
@Derek Kershner, @thdxr it is happening again. Apparently when the stack is deployed from scratch things are faster, but if we add new lambdas to existing stack cold start becomes bad... This time took 17.58 sec
t

thdxr

12/31/2021, 3:29 AM
Hey Samir what version are you on
s

Samir Baid

12/31/2021, 3:30 AM
"@serverless-stack/cli": "0.54.4",     "@serverless-stack/resources": "0.54.4",
SST?
t

thdxr

12/31/2021, 3:41 AM
can you try going to latest?
are you on windows btw?
s

Samir Baid

12/31/2021, 3:47 AM
yes.. i am on windows
u mean 0.55.1?
switching to 0.55.1 seems to have done the trick... Now things are fast again... i'll do some more tests and if i see concerns will let u guys know... Thanks a lot for helping out
f

Frank

12/31/2021, 9:16 AM
@Samir Baid Ah nice. This sounds like an issue we fixed in 0.55.0!
You should be good 🤓 But let us know if you run into this again.