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

Change `nix.maxJobs` default to reflect remote builds #79183

Closed

Conversation

@Gabriel439
Copy link
Contributor

@Gabriel439 Gabriel439 commented Feb 3, 2020

See: NixOS/nix#1216 (comment)

This ensures that remote builds don't inadvertently exhaust the available
nixbld* users when dealing with over 32 cores

Things done

I did an ad-hoc test of this change against the following file:

let
  nixos = import ../nixpkgs/nixos {
    system = "x86_64-linux";

    configuration.nix = {
      distributedBuilds = true;

      maxJobs = 32;

      buildMachines = [
        { hostName = "example.com";
          sshUser = "example";
          sshKey = "/root/.ssh/id_rsa";
          system = "x86_64-linux";
          maxJobs = 32;
          speedFactor = 1;
          supportedFeatures = [ "kvm" ];
          mandatoryFeatures = [ "perf" ];
        }
      ];
    };
  };

in
  nixos.config.nix.nrBuildUsers

Before this change the above file evaluates to 32. After this change it evaluates to 64. When I set distributedBuilds to false the result changes back to 32.

See: NixOS/nix#1216 (comment)

This ensures that remote builds don't inadvertently exhaust the available
`nixbld*` users when dealing with over 32 cores
@ixmatus
ixmatus approved these changes Feb 3, 2020
Copy link
Contributor

@jonringer jonringer left a comment

diff LGTM

@edolstra
Copy link
Member

@edolstra edolstra commented Feb 4, 2020

Hm, this does not make sense to me. Remote builds do not allocate a build user (see build.cc, the only place where we allocate a build user is in DerivationGoal::startBuilder()).

@Gabriel439
Copy link
Contributor Author

@Gabriel439 Gabriel439 commented Feb 4, 2020

@edolstra: Oh, perhaps I misdiagnosed what is going on. I can close this pull request, then

@Gabriel439 Gabriel439 closed this Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.