You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running into a strange slowdown when locally invoking a lambda function.
Step pulling the docker image always takes around 30 seconds. There's barely any network traffic, so it is not actually downloading it. Maybe a timeout, or it is always computing the checksum? (The same slowdown is present when I do docker pull lambci/lambda
$ time sam local invoke HelloWorld -e event.json
2018/03/29 12:55:26 Successfully parsed template.yaml
�[34mINFO�[0m[0000] Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows
2018/03/29 12:55:26 Connected to Docker 1.37
�[34mINFO�[0m[0000] Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows
2018/03/29 12:55:26 Fetching lambci/lambda:nodejs6.10 image for nodejs6.10 runtime...
nodejs6.10: Pulling from lambci/lambda
Digest: sha256:bc47c223a2accf47c51adc6e1949bda9b557764be38a76ebac73e545044079cc
Status: Image is up to date for lambci/lambda:nodejs6.10
2018/03/29 12:55:58 Invoking index.handler (nodejs6.10)
2018/03/29 12:55:58 Mounting /d/prog/sam-node-hello-world as /var/task:ro inside runtime container
�[32mSTART RequestId: 9556341d-a069-139c-cef9-eb19b1ea1c41 Version: $LATEST�[0m
�[34m2018-03-29T10:56:00.433Z 9556341d-a069-139c-cef9-eb19b1ea1c41 �[0mLOG: Name is Bob
�[32mEND RequestId: 9556341d-a069-139c-cef9-eb19b1ea1c41�[0m
�[32mREPORT RequestId: 9556341d-a069-139c-cef9-eb19b1ea1c41 Duration: 6.09 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 28 MB �[0m
"Hello Bob"
real 0m33.644s
user 0m0.000s
sys 0m0.000s
I would expect performance similar to invoking it directly.
$ time docker run -v "$PWD":/var/task lambci/lambda index.handler '{"name" : "Bob"}'
START RequestId: d14605bd-2f8e-1aad-0b06-ea972b2ff0a3 Version: $LATEST
2018-03-29T11:08:29.563Z d14605bd-2f8e-1aad-0b06-ea972b2ff0a3 LOG: Name is Bob
END RequestId: d14605bd-2f8e-1aad-0b06-ea972b2ff0a3
REPORT RequestId: d14605bd-2f8e-1aad-0b06-ea972b2ff0a3 Duration: 6.03 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 23 MB
"Hello Bob"
real 0m0.883s
user 0m0.015s
sys 0m0.000s
The text was updated successfully, but these errors were encountered:
If you experience the same slowdown by just doing docker pull lambci/lambda then something is wrong with docker, not sam-local. You should look or ask for a solution elsewhere.
In the meantime, you can try sam local invoke --skip-pull-image=true HelloWorld -e event.json
* logs command improvements
* update help text and move imports into method
* throttling checks, generating new session and client for every coroutine, use boto StackResource object instead of creating our own
* remove mypy boto stubs usage, raise exception other than throttling, use common static var for lambda name
* make black & pylint happy
I'm running into a strange slowdown when locally invoking a lambda function.
Step pulling the docker image always takes around 30 seconds. There's barely any network traffic, so it is not actually downloading it. Maybe a timeout, or it is always computing the checksum? (The same slowdown is present when I do
docker pull lambci/lambda
I would expect performance similar to invoking it directly.
The text was updated successfully, but these errors were encountered: