-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Lambda performance is poor without docker-reuse flag #4013
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
Comments
@calmoo I'm having some issues with lambda performance even with docker-reuse (~12 seconds cold start, ~8 seconds once warm). What sort of response times do you see with docker-reuse? |
@jleck After first invocation, I got the response time down from ~10-12 seconds to under 1 second. |
Might be something my end that's slowing it down still then after the first. Thanks! |
@calmoo What's your setup to achieve <1s ? See my issue with my setup: #4042 |
I'm doing some extensive testing on our services using localstack, and the slowness is kinda annoying. Can someone explain why a lambda should even take 1s (which is what I'm seeing) with docker-reuse. In AWS we get milliseconds. Isn't it just a method call to the handler function? Is the container reinitialized for each invoke? |
Thanks for reporting @tobias-zeptio @ThomasLabstep @jleck @noahskelton . We have recently introduced "stay-open" mode which further improves the Lambda execution times, and is now the default for the From a compatibility perspective we're currently still leaning towards having |
Type of request: This is a ...
[ ] bug report
[x] feature request
Detailed description
I was experiencing very high CPU usage when invoking an API gateway lambda in fairly frequent succession - this was resolved by using the
LAMBDA_EXECUTOR=docker-reuse
flag in the docker-compose configuration, allowing the container to be reused after the first lambda invocation.docker
is the default rather thandocker-reuse
for theLAMBDA_EXECUTOR
flag?Expected behavior
Actual behavior
Steps to reproduce
Command used to start LocalStack
Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
The text was updated successfully, but these errors were encountered: