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

Bazel creates a lot of write IO for sandboxed action #2921

Closed
abergmeier-dsfishlabs opened this issue May 2, 2017 · 4 comments
Closed

Bazel creates a lot of write IO for sandboxed action #2921

abergmeier-dsfishlabs opened this issue May 2, 2017 · 4 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team type: bug

Comments

@abergmeier-dsfishlabs
Copy link
Contributor

Description of the problem / feature request / question:

We have a rule related to packaging. That rule depends on > 25.000 files. Trying to build that rule it stays in Running for over 10 minutes without the action executable even being started. Since the system is mainly busy with writing, I guess Bazel is setting up the sandbox environment/files?

Question is whether there is anything that could be improved here or the general advise is to disable Sandboxing for that action.
Also is there a rule of thumb when Sandboxing is slowing down builds too much?

Environment info

  • Operating System: Ubuntu 16.04
  • Bazel version (output of bazel info release): 0.4.5

Anything else, information or logs or outputs that would be helpful?

The disk is a HDD - which makes this problem probably even more visible.

@AustinSchuh
Copy link
Contributor

Take a look at Issue #1836 . Does the patch/workaround listed there help you?

@jmmv jmmv added team-Local-Exec Issues and PRs for the Execution (Local) team P2 We'll consider working on this in future. (Assignee optional) and removed category: sandboxing labels Mar 19, 2019
@jmmv
Copy link
Contributor

jmmv commented May 12, 2020

Yes, sandboxing is known to be slow precisely by how many symlinks it creates. It's usually not a problem on Linux with SSDs, but with an HDD I can see that being very painful. (And it's painful on macOS regardless.)

sandboxfs is something that you could try as it was designed precisely to avoid creating the symlinks.

But... given the age of this bug, I suspect this is not relevant any longer.

@jmmv jmmv closed this as completed May 12, 2020
@ulfjack
Copy link
Contributor

ulfjack commented May 13, 2020

I suspect that a lot of people just disable sandboxing when they encounter this. The easier we can make it to use sandboxfs (assuming that solves it), the better. (Keeping in mind that FUSE is disallowed in some places by security policy.)

@AustinSchuh
Copy link
Contributor

@ulfjack , we've been using --experimental_sandbox_base=/dev/shm to put all the symlinks in a tmpfs on Linux. It makes the performance difference negligible. Simpler than FUSE, and probably as fast or faster.

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-Local-Exec Issues and PRs for the Execution (Local) team type: bug
Projects
None yet
Development

No branches or pull requests

5 participants