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

David Martin

08/13/2021, 7:45 PM
Feature request: be able to deploy a single function at a time. Also, be able to deploy a single direct lambda function that lives within appsync too. Similar to this; https://www.serverless.com/framework/docs/providers/aws/cli-reference/deploy-function/
t

thdxr

08/13/2021, 7:48 PM
Terraform has a feature where instead of applying the whole config, you can set the a specific resource with a
target
flag. I did use this once in a while. I'm not sure if that's entirely possible with how CDK works
Can you describe a bit more about how you'd use this feature?
d

David Martin

08/13/2021, 8:02 PM
Yeah. Here’s what I’m experiencing. Local debugging is actually a bit flaky for me and I’m not able to use it consistently, so I would like a faster way to deploy changes. Right now, updating the appsync stack takes about 160 seconds. That
serverless deploy
function can update a lambda in about 2-3 seconds. Why can’t I use local debugging as much as I’d like? Well, my machine spins and runs super slow. I’ve got a 2016 Macbook pro with 16gb of RAM, but it’s chokes when I debug locally. It’s probably because I’ve got a lot of things open at the same time - including an iphone simulator which also has a debugger connected to my react-native app. But it will run so slowly that requests from my phone simulator timeout before they reach the local stack. I think part of the issue might be that locally, whenever a file is modified, SST calculates CDK changes. Perhaps it should detect a file modification and wait for me to hit enter to recalculate stack changes. I’m going to buy a new mac - but I’m waiting for the next version of the macbook pros to come out this fall.
I wonder if I’m the only person who has performance problems while debugging locally….anyone else have this issue?
r

Ross Coundon

08/13/2021, 8:12 PM
We experienced the opposite, we were using serverless-offline with serverless framework previously to run stuff locally and that chewed up a lot of memory and CPU. On one of my team's linux machine it'd frequently needed a system restart. Running it via
sst start
shifts almost all the load to AWS so works very well for us.
t

thdxr

08/13/2021, 8:41 PM
@David Martin gotcha would you mind opening an issue with what you shared above? I want to leave some thoughts on it so want to make sure it's visible publicly
d

David Martin

08/13/2021, 8:42 PM
sure - do you want an issue for the deployment of a single function, or for the perf issues?
Re: perf - It might just be my machine
t

thdxr

08/13/2021, 8:42 PM
Deployment of a single function
f

Frank

08/14/2021, 12:30 AM
@David Martin, about the perf,
whenever a file is modified, SST calculates CDK changes
SST doesn’t auto rebuild when you change ur Lambda code. When you are working on ur Lambda code, do you have the perf issue? Or the slow down only happens when you are changing the CDK code?
j

Jay

08/14/2021, 12:41 AM
Yeah we gotta make sure it’s not flaky with 16GB!
d

David Martin

08/14/2021, 12:48 AM
@Frank I have to do some more investigating to find the source of the problem. But sometimes the debugger gets so laggy that I have to quit vscode because everything is so unresponsive. It's just been one of those days today.
I need a new machine. If others aren't having this problem then it might be isolated to me. But I don't want to buy a MacBook now only to have a new version come out with better specs. I've waited long enough already
@Frank, I see. It watches for changes to the CDK code: https://docs.serverless-stack.com/live-lambda-development#cdk-builds. One thing - it’d be nice if there was some way to force a redeployment manually while the debugger is running. As I’m modifying my schema.graphql, I need to manually start/stop the debugger to force a redeploy so my changes get pushed to my appsync stack. Not a huge deal and I can continue with that workflow. It might not be all that much faster anyway.
f

Frank

08/14/2021, 1:17 AM
Ah yup that makes sense! Circling back on the perf issue, sst start normally is pretty efficient (I’m running on a dual core MBP). When u get a chance, can u check: • after starting up sst start, how much memory is node/esbuild taking while idle • does it slow down when changing SST code, if so what’s taking cpu/memory? • does it slow down when changing lambda code, if so what’s taking cpu/memory?
a

Ashishkumar Pandey

08/14/2021, 1:19 AM
This could also be a disk issue or the max files open limit could be approaching. Happens a lot on macbooks when using android studio or react-native. I’d suggest keeping an eye on the activity monitor and then figuring out what limits you might be reaching / crossing.
d

David Martin

08/14/2021, 1:58 AM
@Frank ok, i’ll get those numbers for you. i’m also on a dual core MBP (3.5 GHz Dual-Core Intel Core i7). @Ashishkumar Pandey - oh, this could be the right path! i’ll take a look into the disk issue first. i’ll try running disk first aid or something.
a

Ashishkumar Pandey

08/14/2021, 2:29 AM
sure. I really believe this is a disk or a config issue, all the best.
f

Frank

08/14/2021, 4:52 AM
@David Martin yeah I’m on (2.3 GHz Dual-Core Intel Core i5), I hope that give you some hope 😁
d

David Martin

08/14/2021, 10:42 PM
good news! update: reset PRAM, ran disk first aid and “re-installed” OSX by upgraded OS from Catalina to Big Sur. happy to report that debugging is smooth and works 100% of the time now. thank you @Ashishkumar Pandeyfor the help! 🙏❤️
and thanks, @Frank too 😆
a

Ashishkumar Pandey

08/15/2021, 12:02 AM
This is great. Happy coding. ✌️😁
t

thdxr

08/15/2021, 1:30 AM
Wow that's amazing
2 Views