Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remoteActionBuildingSemaphore slows down highly parallel remote builds #20478

Open
brentleyjones opened this issue Dec 8, 2023 · 4 comments
Open
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@brentleyjones
Copy link
Contributor

brentleyjones commented Dec 8, 2023

Description of the bug:

Highly parallel RBE builds are slower than they need to be because of remoteActionBuildingSemaphore.

Which category does this issue belong to?

Remote Execution

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Have a build that can do 300+ actions at once, use --jobs=300, and a host machine with 24 or fewer threads. Build clean once with Bazel 7.0.0. Build clean once with remoteActionBuildingSemaphore usage commented out. Compare and see that the second build is faster.

Which operating system are you running Bazel on?

Ubuntu 22.04

What is the output of bazel info release?

development version

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

Built the release-7.0.0 branch and modified it per above.

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

#17120 / 4069a87 added the semaphore

Any other information, logs, or outputs that you want to share?

No response

@meisterT
Copy link
Member

cc @coeuvre @EdSchouten

@brentleyjones for your build, did you see any impact on peak memory from your change?

@brentleyjones
Copy link
Contributor Author

@meisterT Yes, it's higher, but not massively so. Similar to @werkt's comment (#19924 (comment)), it depends on the build at hand. To quote him:

remoteActionBuildingSemaphore is being used to regulate CPU and RAM pressure - merkle or generalized RAM estimation should be used to regulate the latter, distinct from the former, in low overhead merkle tree situations (bazel-stress uses minimal inputs and only measures action throughput, so it is a pathological representation of the lowest possible memory overhead).

@meisterT
Copy link
Member

Compare and see that the second build is faster.

How much faster is this for you when you comment out the code?

@meisterT meisterT added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Dec 12, 2023
@brentleyjones
Copy link
Contributor Author

The remote portion of the build is 40% faster, so quite a lot.

coeuvre added a commit to coeuvre/bazel that referenced this issue Dec 15, 2023
to allow users temporarily disable remote action building throttle.

Workaround for bazelbuild#20478.
@coeuvre coeuvre self-assigned this Jan 8, 2024
copybara-service bot pushed a commit that referenced this issue Jan 11, 2024
to allow users temporarily disable remote action building throttle.

Workaround for #20478.

Closes #20558.

PiperOrigin-RevId: 597445193
Change-Id: Ib2c7133adf86139b35156d94e39cbf9e17906439
bazel-io pushed a commit to bazel-io/bazel that referenced this issue Jan 11, 2024
to allow users temporarily disable remote action building throttle.

Workaround for bazelbuild#20478.

Closes bazelbuild#20558.

PiperOrigin-RevId: 597445193
Change-Id: Ib2c7133adf86139b35156d94e39cbf9e17906439
github-merge-queue bot pushed a commit that referenced this issue Jan 12, 2024
to allow users temporarily disable remote action building throttle.

Workaround for #20478.

Closes #20558.

Commit
294c904

PiperOrigin-RevId: 597445193
Change-Id: Ib2c7133adf86139b35156d94e39cbf9e17906439

Co-authored-by: Chi Wang <chiwang@google.com>
github-merge-queue bot pushed a commit that referenced this issue Jan 12, 2024
to allow users temporarily disable remote action building throttle.

Workaround for #20478.

Closes #20558.
Commit
294c904

PiperOrigin-RevId: 597445193
Change-Id: Ib2c7133adf86139b35156d94e39cbf9e17906439

Co-authored-by: Chi Wang <chiwang@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

No branches or pull requests

6 participants