GNU bug report logs - #41720
[PATCH] store: Use buffered I/O for all protocol writes

Previous Next

Package: guix-patches;

Reported by: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>

Date: Fri, 5 Jun 2020 09:12:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: 41720 <at> debbugs.gnu.org
Subject: [bug#41720] [PATCH] store: Use buffered I/O for all protocol writes
Date: Fri, 5 Jun 2020 11:11:51 +0200
[Message part 1 (text/plain, inline)]
Hi,

I did some digging to investigate why SSH-based guix operations are currently
so slow. One of the reasons seems to be that some operations write single words
to the socket and due to NOWAIT these result in a lot of small packets.

The attached patch modifies store.scm to buffer all writes, so that won’t happen
any more. I’m seeing about ~40% speedup (6.194s vs 10.075s for the best out of
five runs) for `GUIX_DAEMON_SOCKET=ssh://localhost guix environment guix --
true`, but it also seems to have a negative impact on UNIX domain socket
communication by ~10% (1.561s vs 1.385s). For the notorious r-learnr package
it’s still ~20% better (ssh, 16.620/21.418) and only ~3% worse (unix,
11.489/11.199). Keep in mind localhost has a much larger MTU and much lower
latency than usual networks though. It might benefit from having an even bigger
write buffer (64k vs. currently 8k).

Cheers,
Lars

[0001-store-Use-buffered-I-O-for-all-protocol-writes.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 65 days ago.

Previous Next


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