services: guix-publish: Add zstd compression by default.

That way, the default config with (advertises? #t) and without a cache
will offer zstd-compressed substitutes, which should lead to much higher
throughput than gzip.

* gnu/services/base.scm (default-compression): When
'guix-publish-configuration-cache' returns true, use higher level
compression ratios.  Add "zstd".
* doc/guix.texi (Base Services): Mention zstd.
This commit is contained in:
Ludovic Courtès 2021-04-03 20:37:11 +02:00
parent b495254efb
commit 58beda0121
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 6 additions and 2 deletions

View file

@ -15646,7 +15646,7 @@ This allows neighboring Guix devices with discovery on (see
@code{guix-configuration} above) to discover this @command{guix publish} @code{guix-configuration} above) to discover this @command{guix publish}
instance and to automatically download substitutes from it. instance and to automatically download substitutes from it.
@item @code{compression} (default: @code{'(("gzip" 3))}) @item @code{compression} (default: @code{'(("gzip" 3) ("zstd" 3))})
This is a list of compression method/level tuple used when compressing This is a list of compression method/level tuple used when compressing
substitutes. For example, to compress all substitutes with @emph{both} lzip substitutes. For example, to compress all substitutes with @emph{both} lzip
at level 7 and gzip at level 9, write: at level 7 and gzip at level 9, write:

View file

@ -1816,7 +1816,11 @@ (define (default-compression config properties)
raise a deprecation warning if the 'compression-level' field was used." raise a deprecation warning if the 'compression-level' field was used."
(match (%guix-publish-configuration-compression-level config) (match (%guix-publish-configuration-compression-level config)
(#f (#f
'(("gzip" 3))) ;; Default to low compression levels when there's no cache so that users
;; get good bandwidth by default.
(if (guix-publish-configuration-cache config)
'(("gzip" 5) ("zstd" 19))
'(("gzip" 3) ("zstd" 3)))) ;zstd compresses faster
(level (level
(warn-about-deprecation 'compression-level properties (warn-about-deprecation 'compression-level properties
#:replacement 'compression) #:replacement 'compression)