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

How to use in AWS Lambda #138

Closed
bikerp opened this issue Jan 7, 2019 · 5 comments
Closed

How to use in AWS Lambda #138

bikerp opened this issue Jan 7, 2019 · 5 comments

Comments

@bikerp
Copy link
Contributor

bikerp commented Jan 7, 2019

Hi,
I'd like to use your project in AWS environment using Lambda. I have already tried but it seems that initialization takes too long (approx. 2 seconds). Any idea what part of the code could be ommited in AWS?
Thanks
Pavel

@adrai
Copy link
Contributor

adrai commented Jan 7, 2019

probably the parsing of the files takes too much time.... try to run it with DEBUG=domain* to see what takes so much time...
btw: this module was never built to use for an "on-request" execution...

@bikerp
Copy link
Contributor Author

bikerp commented Jan 8, 2019

Thanks for the response. It seems that the eventstore initialization takes most of the time. Could you please explain meaning of individual fields of events table (DynamoDB) in eventstore? I have some idea but I'd like to be sure. Thanks

@adrai
Copy link
Contributor

adrai commented Jan 8, 2019

Perhaps @developmentalmadness can help?

@developmentalmadness
Copy link

Haven't looked at this for 2.5 years now so I don't remember the mechanics. But we used this in Lambda exclusively on the project I was working on at the time. I haven't followed progress, so I don't know if anything has changed to affect it's ability to run in that environment since.

As for the slow initialization time you may want to look at the ReadCapacityUnits and WriteCapacityUnits. In the module the defaults are not set to production values for cost reasons. Having them set so low also achieves two other goals: forcing you to think about what they should be before going to prod instead of getting caught by the defaults; and running the tests verifies that the retry logic around throttling is working. You'll need to configure those in your startup to reflect the capacity requirements for your project.

One other reason could be the first time you initialize the module it will create the table in DynamoDB for you. When it does it waits until the table becomes active. This process likely takes some time as well.

@bikerp
Copy link
Contributor Author

bikerp commented Feb 5, 2019

Thanks for the answers

@bikerp bikerp closed this as completed Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants