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

let --maxWorkers accept a percent as value #9012

Closed
capaj opened this issue Oct 5, 2019 · 3 comments
Closed

let --maxWorkers accept a percent as value #9012

capaj opened this issue Oct 5, 2019 · 3 comments

Comments

@capaj
Copy link
Contributor

capaj commented Oct 5, 2019

🚀 Feature Proposal

Let --maxWorkers accept a percent as value. If the remaining value is so small that it only matches less than 1 CPU, always make sure we leave at least 1 core free.

Motivation

We run Jest to test stuff that calls a lot of DB calls. When we keep the default and do not set --maxWorkers we often run into issues where test timeout. This happens because OS is very bad at switching CPU resources from Jest transpiling to database and it basically locks up even the beefiest of machines.
So we need to run jest with a slightly smaller number of --maxWorkers than the host system has available CPU threads. For example

  • when running on an OS with 12 CPUs we want to let jest have 10 cores.

  • On a system with 4 cpus, we want to let jest have 3 cpus and leave one of the DB.

  • On a system with 2 cpus, we want to let jest have 1 cpu and leave one of the DB.

Example

jest --maxWorkers=85%

Pitch

because it is convenient for me and there are other people running into similar issues like for example #8407

@thymikee
Copy link
Collaborator

thymikee commented Oct 5, 2019

It's already implemented and available in v24.9.0: b644d85

@thymikee thymikee closed this as completed Oct 5, 2019
@capaj
Copy link
Contributor Author

capaj commented Oct 5, 2019

thanks @thymikee, lovely.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants