[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: services: guix-publish: Add zstd compression by default.
From: |
guix-commits |
Subject: |
01/04: services: guix-publish: Add zstd compression by default. |
Date: |
Sat, 3 Apr 2021 16:10:39 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 58beda01217c48da52e67ac5461f33b6532b5ede
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 3 20:37:11 2021 +0200
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.
---
doc/guix.texi | 2 +-
gnu/services/base.scm | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index da18b45..bada446 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15646,7 +15646,7 @@ This allows neighboring Guix devices with discovery on
(see
@code{guix-configuration} above) to discover this @command{guix publish}
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
substitutes. For example, to compress all substitutes with @emph{both} lzip
at level 7 and gzip at level 9, write:
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index a8214ae..24b3ea7 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1816,7 +1816,11 @@ proxy of 'guix-daemon'...~%")
raise a deprecation warning if the 'compression-level' field was used."
(match (%guix-publish-configuration-compression-level config)
(#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
(warn-about-deprecation 'compression-level properties
#:replacement 'compression)