lerna icon indicating copy to clipboard operation
lerna copied to clipboard

Lerna run take all cpu resources

Open memao opened this issue 6 years ago • 4 comments

Current Behavior

I am using "lerna run build --scope {packge1} --concurrency 1 --stream --profile". I have a 6 core CPU. According to the document, if I set concurrency to 1, only one thread will be generated. But I noticed that all of my CPUs are at 100% usage even for one package. There are more than 10 node.exe process generated by lerna and another two cmd.exe process.

I also run "lerna run build --scope {packge1,package2} --concurrency 2 --stream --profile" for 2 packages. I noticed that the same package took longer when scope is 2 packages vs 1 package. The during increase as I increase more packages in the scope. It seems even when I run 1 package, lerna takes all the CPU resources on my computer.

Expected Behavior

What I was expected is that when I set --concurrency=1, only one thread will be generated by lerna. Also when I run 2 packages in the scope, the package1 should take same during as the thread are parallel for both packages.

I am wondering what did I do wrong in my parameters? how does lerna run works, and what is the correct behavior?

Context

We have a big project that we need to build bundles in 13 apptypes. Each apptype take around 1.2 mins on a 6 core cpu locally. We need to run lerna run --scope {all 13 packages} --stream on a build agent, which is 16 core. It currently take 5 mins.5 mins is too long for us. I would expect it take a lot less. How do I reduce the time?

Executable Version
lerna --version 3.21.0
npm --version VERSION
yarn --version VERSION
node --version VERSION
OS Version
NAME VERSION

memao avatar Jul 05 '20 14:07 memao

Thanks for the undocumented --concurrency 1 feature! It giving a workaround to the lerna run always parallel bug!

Ziv-Barber avatar Jul 09 '20 15:07 Ziv-Barber

Seeing a similar issue: lerna run <command> takes significantly longer than cd ./packages/... && yarn run <command> (if it completes at all). Also maxes out CPU.

bconnorwhite avatar Jul 11 '20 03:07 bconnorwhite

Hi Folks 👋

You may or may not know that lerna is now under the stewardship of Nrwl (announcement here https://github.com/lerna/lerna/issues/3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details).

Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves.

In order to take this awesome project forward from its current state, it is important that we focus our finite resources on what is most important to lerna users in 2022.

With that in mind, we have identified this issue as being potentially stale due to its age and/or lack of recent activity.


Next steps:

We want to give you some time to read through this comment and take action per one of the steps outlined below, so for the next 14 days we will not make any further updates to this issue.

@memao as the original author of this issue, we are looking to you to update us on the latest state of this as it relates to the latest version of lerna.

Please choose one of the steps below, depending on what type of issue this is:

  • A) If this issue relates to a potential BUG in the latest version of lerna:

    • Please head over to https://github.com/lerna/repro, fork the repo and apply the changes necessary to reproduce the bug. Then open a PR to that https://github.com/lerna/repro repo and comment back to this thread with the PR number so that we can take a look into the problem and provide a fix.
  • B) If this issue is a FEATURE request to be added to the latest version of lerna:

    • Simply comment back on this thread so that we know you still want us to consider the request for the latest version of lerna.
  • C) If this issue is a QUESTION which is applicable to latest version of lerna:

    • Please convert the issue to be a Discussion instead: https://github.com/lerna/lerna/discussions
  • D) If this issue is no longer applicable to the latest version of lerna:

    • Please close the issue.

If we do not hear from @memao on this thread within the next 14 days, we will automatically close this issue.

If you are another user impacted by this issue but it ends up being closed as part of this process, we still want to hear from you! Please simply head over to our new issue templates and fill out all the requested details on the template which applies to your situation:

https://github.com/lerna/lerna/issues/new/choose

Thank you all for being a part of this awesome community, we could not be more excited to help move things forward from here 🙏 🚀

github-actions[bot] avatar Jun 03 '22 15:06 github-actions[bot]

Hi Folks 👋

You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.

As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.

If any users, including the original author, are still impacted by this issue then we still want to hear from you!

All we ask is that you first update to the latest lerna (5.1.4 at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:

https://github.com/lerna/lerna/issues/new/choose

Many thanks again! 🙏


P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀

You can read our recent blog post to learn more about what we've been up to: https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7

github-actions[bot] avatar Jun 17 '22 15:06 github-actions[bot]