question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change default concurrency from 4 to available number of cpus

See original GitHub issue

Expected Behavior

It would be nice if concurrency defaulted to os.cpus()

Current Behavior

Concurrency defaults to 4 no matter what.

Possible Solution

Change the DEFAULT_CONCURRENCY variable to be os.cpus(). Alternatively, enable this only with a flag to avoid a breaking change.

Context

This would allow jobs to scale easily with different instance sizes when running in things like EC2. I have some tasks that run sometimes in a 4 core machine and sometimes in a 16 core machine or even larger.

Most local machines have 4 cores anyway, so they would remain unchanged. But it’s hard to maximize concurrency using only the CLI right now.

"run-stuff": "lerna run task --concurrency 8"

If I have a package.json task like above, it’s hard to access the number of available CPUS to set the concurrency level. I need to instead run the lerna task from a node script, which is less convenient. Ideally, it would always maximize concurrency without needing to avoid the CLI. Or at least have that be available with a flag, like --maximize-concurrency.

If this is something you’ll consider, I’m happy to do a PR to add it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
andrewkincaidcommented, Feb 27, 2019

My apologies! Setting concurrency in lerna.json works.

2reactions
worccommented, Apr 3, 2020

is concurrency still a valid option? it’s not listed in the docs:

https://github.com/lerna/lerna#lernajson

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the number of concurrent processes an agent ...
1. Open the installed.properties file on the agent with a text editor. Default location is AgentInstallationDirectory\conf\agent · 2. Add the ...
Read more >
Configuring reserved concurrency - AWS Lambda
This topic details how to manage and configure reserved concurrency. If you want to decrease latency for your functions, use provisioned concurrency.
Read more >
Maxconcurrency in parallel for each - MuleSoft Help Center
Default max concurrency is it 2* cpu cores... So if Ihave 4 cpu....and ... And for Batch Job it is twice the number...
Read more >
How to find out the number of CPUs using python
If you're interested into the number of processors available to your current ... Note that the default value for logical is True ,...
Read more >
Tuning for Concurrency
By default, VectorH tries to balance single-query and multi-query workloads. The key parameters in balancing this are: • The number of CPU cores...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found