Skip to content

Commit

Permalink
Change the default number of workers from # physical core - 1 to `#…
Browse files Browse the repository at this point in the history
… logical core / 2`

Summary:
User report: https://fb.workplace.com/groups/pyreqa/permalink/9251329598290123/

`# logical core / 2` matches what Hack does.

Reviewed By: samwgoldman

Differential Revision: D68584745

fbshipit-source-id: f16da6cbe65b36207f966c3cbafac5fd70061435
  • Loading branch information
grievejia authored and facebook-github-bot committed Jan 24, 2025
1 parent 658b6c7 commit f8452b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,11 @@ def get_number_of_workers(self) -> int:
if number_of_workers is not None and number_of_workers > 0:
return number_of_workers

number_of_physical_cores = psutil.cpu_count(logical=False)
if number_of_physical_cores is None:
number_of_logical_cores = psutil.cpu_count(logical=True)
if number_of_logical_cores is None:
default_number_of_workers = 1
else:
default_number_of_workers = max(1, number_of_physical_cores - 1)
default_number_of_workers = max(1, number_of_logical_cores // 2 - 1)

LOG.info(
"Could not determine the number of Pyre workers from configuration. "
Expand Down

0 comments on commit f8452b6

Please sign in to comment.