Add a global core limit support for goma/rbe builds.

This is very usable for non Google-sized Goma clusters. We want to use
NINJA_CORE_MULTIPLIER logic, but at the same time we don't want to stall
our cluster with super-high -j values.

Bug: 1323475
Change-Id: I2ed414463b4f397a7bcebe42ea0b996e52006cda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3632492
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/92/3632492/2
Aleksey Khoroshilov 3 years ago committed by LUCI CQ
parent 6a1494e5d7
commit 1bc3cd228e

@ -176,9 +176,11 @@ def main(args):
core_multiplier = int(
os.environ.get('NINJA_CORE_MULTIPLIER', default_core_multiplier))
j_value = num_cores * core_multiplier
core_limit = int(os.environ.get('NINJA_CORE_LIMIT', j_value))
j_value = min(j_value, core_limit)
if sys.platform.startswith('win'):
# On windows, j value higher than 1000 does not improve build
# performance.

Loading…
Cancel
Save