GNU bug report logs - #44567
[PATCH] publish: Improve HTTP performance when not using --cache.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 11 Nov 2020 04:00:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 44567 <at> debbugs.gnu.org
Subject: [bug#44567] [PATCH] publish: Improve HTTP performance when not using --cache.
Date: Fri, 13 Nov 2020 18:19:03 +0100
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:

> This change harmonizes the way we configure the buffer sizes and the socket
> options, so that we don't forget to change it at one place like it happened in
> commit 5e3d169945935b53325e6b738a307ba286751259.  Using a greater socket
> buffer size reportedly improves throughput tenfold.
>
> The solution was found by Ludovic Courtès.
>
> * guix/scripts/publish.scm (%default-buffer-size)
> (%default-socket-options): New variables.
> * guix/scripts/publish.scm (configure-socket): New procedure.
> (compress-nar): Use %default-buffer-size for the buffer size, increased from
> 128 to 208 KiB.
> (nar-response-port): Likewise, increased from 64 to 208 KiB.
> (http-write): Use configure-socket to set socket options.
> (open-server-socket): Likewise.

Apologies for not noticing this before pushing
1cbda46d4aae5ba9bd89a1837f0d81a29653ed7b.  What you propose here is
nicer.

> +(define %default-buffer-size
> +  (* 208 1024))

Why 208?  Did you notice a difference compared to 128KiB?  (I’m fine
either way, just wondering.)

Perhaps add a comment as to what buffer we’re talking about.

> +(define %default-socket-options

Maybe add: ;; List of options passed to 'setsockopt' when transmitting files.

> +  (list (list SO_SNDBUF %default-buffer-size)))

>       (make-gzip-output-port (response-port response)
>                              #:level level
> -                            #:buffer-size (* 64 1024)))
> +                            #:buffer-size %default-buffer-size))

Does the gzip buffer size have to match the TCP buffer size?  I’d say
not necessarily, so perhaps we should have a separate variable for the
gzip buffer size (or keep it as is).

That’s it, thank you!

Ludo’.




This bug report was last modified 4 years and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.