Skip to content

Commit

Permalink
Make number of parallel substituter queries configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Oct 6, 2021
1 parent 53e4794 commit b3104c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/libstore/globals.hh
Expand Up @@ -250,6 +250,17 @@ public:
)",
{"build-use-substitutes"}};

Setting<unsigned int> maxQuerySubstitutersJobs{
this, 25, "max-query-substituters-jobs",
R"(
This option defines the maximum number of parallel queries Nix will
use to ask substituters for the presence of substitutes (which is a
separate step from actually downloading substitutes). For builds of
many derivations backed by substituters supporting HTTP/2,
significant speedups of this step have been observed by increasing
this option thanks to request multiplexing.
)"};

Setting<std::string> buildUsersGroup{
this, "", "build-users-group",
R"(
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/misc.cc
Expand Up @@ -100,7 +100,7 @@ void Store::queryMissing(const std::vector<DerivedPath> & targets,

downloadSize_ = narSize_ = 0;

ThreadPool pool;
ThreadPool pool(settings.maxQuerySubstitutersJobs);

struct State
{
Expand Down

0 comments on commit b3104c2

Please sign in to comment.