Skip to content

Commit

Permalink
Limit the number of parallel Bazel actions (#11779)
Browse files Browse the repository at this point in the history
Limit the number of parallel actions spawned by Bazel to the number of
physical CPUs. (Assuming a CPU with hyperthreading enabled)

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <[email protected]>
  • Loading branch information
aherrmann-da and aherrmann authored Nov 18, 2021
1 parent a9754fe commit 5fb5784
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ build --experimental_strict_action_env
# in us getting a certificate for githubassets.com instead.
startup --host_jvm_args=-Xms2g --host_jvm_args=-Xmx2g --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2

# Limit the number of parallel actions spawned by Bazel to the number of
# physical CPUs. (Assuming a CPU with hyperthreading enabled)
build --loading_phase_threads="HOST_CPUS*.5"
fetch --loading_phase_threads="HOST_CPUS*.5"
query --loading_phase_threads="HOST_CPUS*.5"
sync --loading_phase_threads="HOST_CPUS*.5"
build --local_cpu_resources="HOST_CPUS*.5"

# Enable sandboxing and caching for exclusive tests
build --incompatible_exclusive_test_sandboxed

Expand Down
8 changes: 8 additions & 0 deletions compatibility/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ build --experimental_strict_action_env
# in us getting a certificate for githubassets.com instead.
startup --host_jvm_args=-Xms2g --host_jvm_args=-Xmx2g --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2

# Limit the number of parallel actions spawned by Bazel to the number of
# physical CPUs. (Assuming a CPU with hyperthreading enabled)
build --loading_phase_threads="HOST_CPUS*.5"
fetch --loading_phase_threads="HOST_CPUS*.5"
query --loading_phase_threads="HOST_CPUS*.5"
sync --loading_phase_threads="HOST_CPUS*.5"
build --local_cpu_resources="HOST_CPUS*.5"

# Enable sandboxing and caching for exclusive tests
build --incompatible_exclusive_test_sandboxed

Expand Down

0 comments on commit 5fb5784

Please sign in to comment.