Commit 650dde9a authored by Koray Polat's avatar Koray Polat Committed by Facebook GitHub Bot

Use half of available CPUs

Summary: During intensive builds using all available cores tends to crash the machine. Cutting default number of jobs by half prevents that.

Reviewed By: wez

Differential Revision: D25027757

fbshipit-source-id: 5ea6c77fe4363b9ee09e50de1a5cc33281872e1d
parent 1104513c
......@@ -288,9 +288,7 @@ def get_jobs_argument(num_jobs_arg: int) -> str:
return "-j" + str(num_jobs_arg)
import multiprocessing
num_jobs = multiprocessing.cpu_count()
if sys.platform == "win32":
num_jobs //= 2
num_jobs = multiprocessing.cpu_count() // 2
return "-j" + str(num_jobs)
......
......@@ -73,15 +73,7 @@ class BuildOptions(object):
if not num_jobs:
import multiprocessing
num_jobs = multiprocessing.cpu_count()
if is_windows():
# On Windows the cpu count tends to be the HT count.
# Running with that level of concurrency tends to
# swamp the system and make hard to perform other
# light work. Let's halve the number of cores here
# to win that back. The user can still specify a
# larger number if desired.
num_jobs = int(num_jobs / 2)
num_jobs = multiprocessing.cpu_count() // 2
if not install_dir:
install_dir = os.path.join(scratch_dir, "installed")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment