Skip to content
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

on MacOS, mounting /tmp/localstack makes lambdas slow #2515

Closed
yonahforst opened this issue Jun 5, 2020 · 2 comments
Closed

on MacOS, mounting /tmp/localstack makes lambdas slow #2515

yonahforst opened this issue Jun 5, 2020 · 2 comments

Comments

@yonahforst
Copy link
Contributor

@yonahforst yonahforst commented Jun 5, 2020

Type of request: This is a ...

[x] bug report
[ ] feature request

Detailed description

When running localstack on MacOS using the example docker-compose.yml, Lambda functions can take a long time to start up.

I think this is because of existing performance issues with osxfs, the file system server in Docker for Mac.

If your using LAMBDA_EXECUTOR=docker, the copying of zipped code to new lambci/lambda containers can take a very long time.

If you're using serverless-localstack, enabling mountCode solves the slow copying, but then actually requiring your code inside the lambda function can take a long time (mostly because of node_modules).

To solve this, I disabled mounting /tmp/localstack in my docker-compose.yml

    volumes:
      # - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

...

Expected behavior

...

Actual behavior

...

Steps to reproduce

Command used to start LocalStack

...

Client code (AWS SDK code snippet, or sequence of "awslocal" commands)

...

@whummer
Copy link
Member

@whummer whummer commented Jun 6, 2020

Thanks for reporting @yonahforst . Not sure if this is a bug per se, but performance can indeed become a bit slow if you're using large Lambda archives in the mounted tmp folder under MacOS. Would you mind creating a pull request with a small note in the README that describes your fix (perhaps in the Troubleshooting section)? Apart from the documentation change, is there anything else you think we can/should do here? Thanks

@whummer
Copy link
Member

@whummer whummer commented Jun 20, 2020

Thanks again. A short note on performance and Lambda mounting has now been added to the Troubleshooting part of the README: https://github.com/localstack/localstack#troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants