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

Webpack compile lambda's sequentially #536

Closed
marcelpanse opened this issue Sep 3, 2019 · 6 comments
Closed

Webpack compile lambda's sequentially #536

marcelpanse opened this issue Sep 3, 2019 · 6 comments

Comments

@marcelpanse
Copy link

This is a (Bug Report / Feature Proposal)

Description

Deploying an individual lambda function in our project (including compiling/packaging/deploying) takes only 4-5seconds. We have around 40+ lamda's in our project. When we do a full serverless deploy of all function, serverless will launch the webpack compiler for all 40 functions at the same time. This results in 100% CPU usage for 13 minutes because all the threads cannabalize on each other (also my computer because unbearable slow because of the CPU hog).
If all 40 functions would be compiled sequentially it should take around 5*40 = 2,5 to 3 minutes to compile everything (10 times faster!).
What would really help is a simple config flag that launches all compile threads sequentially instead.

  • If there is additional config how would it look
    custom:
    webpack:
    webpackConfig: 'webpack.config.js'
    sequentially: true
@tysoncadenhead
Copy link

This would be a really nice feature to have. This issue is keeping me from being able to package my functions individually because it hogs the threads and crashes in a CI environment.

@tysoncadenhead
Copy link

It looks like this is being worked on: #570

@roni-frantchi
Copy link

Regardless of #570 this one would be nice to have -
Though instead of setting it to sequentially or not, I wish we could control how many functions should be packaged in parallel:

custom:
  webpack:
    webpackConfig: 'webpack.config.js'
    parallel: 2

@Wytrykus
Copy link

This would be great to have indeed!
Does anybody know what part of the code would need to be modified?
In my naive mind, it should be rather simple to do the identical process sequentially instead of in parallel, or not?

@kloben
Copy link

kloben commented Aug 1, 2022

At least in my current version (5.8.0) you can set the desired concurrency. I guess setting concurrency to 1 would make it sequential.

custom:
  webpack:
    concurrency: 2

Docs: https://github.com/serverless-heaven/serverless-webpack#individual-packaging-concurrency

@vicary
Copy link
Member

vicary commented Aug 1, 2022

This should be well resolved via concurrency, please reopen if the problem persists.

@vicary vicary closed this as completed Aug 1, 2022
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

6 participants