[reclient] Limit local resource tuning on windows to cloudtops

Bug: b/330173550
Change-Id: I65ce93eeb216a7a4b77506fbcb515697fdecde2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5420670
Commit-Queue: Ben Segall <bentekkie@google.com>
Reviewed-by: Michael Savigny <msavigny@google.com>
changes/70/5420670/3
Ben Segall 2 years ago committed by LUCI CQ
parent 5dc83f8b37
commit 90d54ff344

@ -274,13 +274,30 @@ def set_mac_defaults():
os.environ.setdefault("RBE_deps_cache_max_mb", "1024")
def is_win_ctop():
if not sys.platform.startswith("win"):
return False
import winreg
try:
bios = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE,
r"SOFTWARE\\GWindows")
model = winreg.QueryValueEx(bios, "Model")
val = len(model) > 0 and model[0] == 'Google Compute Engine'
if bios:
winreg.CloseKey(bios)
return val
except OSError:
return False
def set_win_defaults():
# Enable the deps cache on windows. This makes a notable improvement
# in performance at the cost of a ~200MB cache file.
os.environ.setdefault("RBE_enable_deps_cache", "true")
# Reduce local resource fraction used to do local compile actions on
# windows, to try and prevent machine saturation.
os.environ.setdefault("RBE_local_resource_fraction", "0.05")
if is_win_ctop():
# Reduce local resource fraction used to do local compile actions on
# windows, to try and prevent machine saturation.
os.environ.setdefault("RBE_local_resource_fraction", "0.05")
def workspace_is_cog():

Loading…
Cancel
Save