summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-11-10 22:56:38 +0100
committerLudovic Courtès <ludo@gnu.org>2020-11-10 22:56:38 +0100
commit1cbda46d4aae5ba9bd89a1837f0d81a29653ed7b (patch)
tree617c59814b219a98c90e7bb4cb7cec43cc1323cd
parent000e7a0abc747ab6eb4fc23e80e4e9fbe8e75781 (diff)
downloadguix-1cbda46d4aae5ba9bd89a1837f0d81a29653ed7b.tar.gz
publish: Increase TCP buffer size when sending non-cached nars.
This increases throughput tenfold (!) on localhost when downloading
large nars without '--cache'.  This is a followup to
5e3d169945935b53325e6b738a307ba286751259.

Reported by Maxim Cournoyer.

* guix/scripts/publish.scm (http-write): In the
'application/x-nix-archive' case, add call to 'setsockopt'.
-rw-r--r--guix/scripts/publish.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index e3c8711f5b..a976a9ac60 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -891,6 +891,8 @@ blocking."
                                             client))
                (port        (begin
                               (force-output client)
+                              (setsockopt client SOL_SOCKET
+                                          SO_SNDBUF (* 128 1024))
                               (nar-response-port response compression))))
           ;; XXX: Given our ugly workaround for <http://bugs.gnu.org/21093> in
           ;; 'render-nar', BODY here is just the file name of the store item.