guix/scripts
Eelco Dolstra 11800e6198 download-from-binary-cache: parallelise fetching of NAR info files
Getting substitute information using the binary cache substituter has
non-trivial latency overhead.  A package or NixOS system configuration
can have hundreds of dependencies, and in the worst case (when the
local info cache is empty) we have to do a separate HTTP request for
each of these.  If the ping time to the server is t, getting N info
files will take tN seconds; e.g., with a ping time of 0.1s to
nixos.org, sequentially downloading 1000 info files (a typical NixOS
config) will take at least 100 seconds.

To fix this problem, the binary cache substituter can now perform
requests in parallel.  This required changing the substituter
interface to support a function querySubstitutablePathInfos() that
queries multiple paths at the same time, and rewriting queryMissing()
to take advantage of parallelism.  (Due to local caching,
parallelising queryMissing() is sufficient for most use cases, since
it's almost always called before building a derivation and thus fills
the local info cache.)

For example, parallelism speeds up querying all 1056 paths in a
particular NixOS system configuration from 116s to 2.6s.  It works so
well because the eccentricity of the top-level derivation in the
dependency graph is only 9.  So we only need 10 round-trips (when
using an unlimited number of parallel connections) to get everything.

Currently we do a maximum of 150 parallel connections to the server.
Thus it's important that the binary cache server (e.g. nixos.org) has
a high connection limit.  Alternatively we could use HTTP pipelining,
but WWW::Curl doesn't support it and libcurl has a hard-coded limit of
5 requests per pipeline.
2012-07-06 19:08:20 -04:00
..
build-remote.pl.in Support mandatory system features in the build hook 2012-04-30 17:22:45 -04:00
copy-from-other-stores.pl.in * Add a -I flag to the Perl bindings to nix-build and some other 2012-01-05 20:33:46 +00:00
copying-collector.pl * I said it couldn't be done. I was wrong. 2005-04-04 15:18:19 +00:00
download-from-binary-cache.pl.in download-from-binary-cache: parallelise fetching of NAR info files 2012-07-06 19:08:20 -04:00
download-using-manifests.pl.in * download-using-manifests: use the Perl bindings. 2011-11-29 13:01:24 +00:00
find-runtime-roots.pl.in * Set the executable bit on scripts. 2011-10-10 22:40:17 +00:00
install-nix-from-closure.sh Generate binary tarballs for installing Nix 2012-05-22 18:36:54 -04:00
Makefile.am First attempt at the manifest-less substituter 2012-06-29 18:28:52 -04:00
nix-build.in Handle the case where $SHELL is not set 2012-04-10 13:52:37 +02:00
nix-channel.in nix-channel --update: allow updating only the specified channels 2012-05-07 17:55:56 -04:00
nix-collect-garbage.in * Add a -I flag to the Perl bindings to nix-build and some other 2012-01-05 20:33:46 +00:00
nix-copy-closure.in If "pv" is available at compile time, hard-code its path 2012-04-13 14:41:33 +02:00
nix-generate-patches.in nix-generate-patches: Optionally write new patches to $NIX_ALL_PATCHES 2012-04-04 20:46:18 +00:00
nix-http-export.cgi.in Replace wrong (w.r.t. PATH) sed call with in-shell substitution 2009-02-19 20:46:45 +00:00
nix-install-package.in * Add a -I flag to the Perl bindings to nix-build and some other 2012-01-05 20:33:46 +00:00
nix-prefetch-url.in * nix-prefetch-url: rewritten in Perl. 2011-12-02 12:09:50 +00:00
nix-profile.sh.in Update nix profile: - incorporate NixOS's configuration so that nix is usable by normal users - install as a data file, not a program file 2012-05-31 08:59:36 -04:00
nix-pull.in Now *really* prevent accumulation of old manifests 2012-05-07 17:23:26 -04:00
nix-push.in nix-push: Always generate base-32 hashes 2012-07-02 18:05:57 -04:00
nix-reduce-build.in * Set the executable bit on scripts. 2011-10-10 22:40:17 +00:00
remove-patches.pl * Remove the localPaths feature in manifests since it's no longer used 2011-04-06 09:16:22 +00:00
show-duplication.pl * `show-duplication.pl', a small utility that shows the amount of 2006-09-19 13:53:35 +00:00