Skip to content

Limit CPU usage of actions (or all sandboxed operations) #11275

Closed

Description

@prashantv

Description of the problem / feature request:

Ability to limit CPU usage of a single action to a single core.

Feature requests: what underlying problem are you trying to solve with this feature?

By default, bazel runs multiple actions in parallel, with concurrency determined by number of cores available. This has an implicit assumption that actions use a single core, but it's possible for actions to use more cores, which can end up negatively affecting other tests, as they may be CPU starved.

Ideally, bazel would set CPU limits such that a single action is limited to 1 core.

What operating system are you running Bazel on?

Linux 4.14 and 4.19

What's the output of bazel info release?

release 3.0.0

Have you found anything relevant by searching the web?

No, most of the resources I've found are about increasing the number of parallel jobs, or performance of the sandbox.

Activity

  1. jwnimmer-tri commented on May 1, 2020

    @jwnimmer-tri
    Contributor

    Possibly related to #3688 and #6477.

  2. added
    team-Local-Exec
    untriaged
    on May 3, 2020
  3. susinmotion commented on May 4, 2020

    @susinmotion
    Contributor

    @jin is this related to any of the work you're doing?

  4. jin commented on May 4, 2020

    @jin
    Member

    Not quite, I was more interested in restricting the degree of parallelism for a subset of actions, assuming they all use a single core each.

  5. susinmotion commented on May 4, 2020

    @susinmotion
    Contributor

    Gotcha, thanks.

  6. jmmv commented on May 14, 2020

    @jmmv
    Contributor

    I think this is actually a dup of #10443. Just as we should allow actions to use more threads if possible, we should also limit them when not. Will add a note there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateteam-Local-Execuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions