Skip to content

Actions fetched from remote cache / executed remotely should not count towards parallelism limit #6394

Open

Description

@ob

When a fairly large application is built using the remote cache, and all the actions are fully cached. Bazel still keeps the parallelism set to the number of cores in the machine. However, most actions are just waiting for network I/O.

With the default settings on an 8-core machine, I get:

$ time bazel build //...
## output elided
INFO: Elapsed time: 97.567s, Critical Path: 26.44s
INFO: 2000 processes: 2000 remote cache hit.
INFO: Build completed successfully, 2240 total actions

real	1m38.518s
user	0m0.051s
sys	0m0.061s

But if I bump up the number of jobs to a crazy number:

$ time bazel build --jobs 2000 //...
## output elided
INFO: Elapsed time: 39.535s, Critical Path: 31.33s
INFO: 2000 processes: 2000 remote cache hit.
INFO: Build completed successfully, 2240 total actions

real	0m40.483s
user	0m0.048s
sys	0m0.058s

I think the --jobs option should only apply to local actions.

Activity

  1. changed the title [-]Actions fetched from remote cache should not count towards parallelism[/-] [+]Actions fetched from remote cache should not count towards parallelism limit[/+] on Oct 15, 2018
  2. added
    untriaged
    on Oct 17, 2018
  3. added this to the Remote Execution milestone on Oct 17, 2018
  4. buchgr commented on Oct 30, 2018

    @buchgr
    Contributor

    Thanks @ob! A colleague of mine has a prototype of this, however I still expect this to be at least 3-6 months away to land in a released Bazel version!

  5. philwo commented on Nov 6, 2018

    @philwo
    Member

    FWIW, we "fix" this in Google by actually running with --jobs=200 (or higher). Local actions are still limited by local resources, so this is fine in general.

  6. added
    P2
    and removed
    untriaged
    on Nov 6, 2018
  7. buchgr commented on Nov 6, 2018

    @buchgr
    Contributor

    @philwo @ulfjack has a prototype patch to no longer be limited by --jobs for remote execution.

  8. ittaiz commented on Jan 6, 2019

    @ittaiz
    Member

    @philwo

    Local actions are still limited by local resources, so this is fine in general.

    Means you run with jobs together with local_resources?

  9. added
    team-Remote-Exec
    and removed on Jan 14, 2019
  10. 72 remaining items

  11. added
    stale
    on May 10, 2023
  12. added
    not stale
    and removed
    stale
    on May 10, 2023
  13. meisterT commented on May 10, 2023

    @meisterT
    Member

    We are working on this again, in a different way. Next step is to upgrade to a modem JDK which will allow us to use loom/virtual threads.

  14. Ryang20718 commented on May 16, 2023

    @Ryang20718

    Reading through this thread.

    If I'm using local execution with a remote cache and almost all tests are cached. with --jobs set to 4, I see. (currently on bazel 6.0.0)

    21s remote-cache, linux-sandbox ... (8 actions running)
    29s remote-cache, linux-sandbox ... (8 actions running)
    

    With jobs set to 8, I see a max of 16 actions. This would mean jobs fetching from remote cache is not counting towards parallelism. Is there a way we can configure it to do so?

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

Metadata

Metadata

Assignees

Labels

P2not staleteam-Performancetype: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions