From 5728011da1aae308694a7098e00610b78d49451b Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 22 Feb 2024 14:45:17 +0100 Subject: [PATCH] queue-runner: try larger pipe buffer sizes (cherry picked from commit 18466e83261d39b997a73bbd9f0f249c3a91fbeb) --- src/hydra-queue-runner/build-remote.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index ad510e1b..1cabd291 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -54,9 +54,20 @@ static std::unique_ptr openConnection( command.splice(command.end(), extraStoreArgs(machine->sshName)); } - return master.startCommand(std::move(command), { + auto ret = master.startCommand(std::move(command), { "-a", "-oBatchMode=yes", "-oConnectTimeout=60", "-oTCPKeepAlive=yes" }); + + // XXX: determine the actual max value we can use from /proc. + + // FIXME: Should this be upstreamed into `startCommand` in Nix? + + int pipesize = 1024 * 1024; + + fcntl(ret->in.get(), F_SETPIPE_SZ, &pipesize); + fcntl(ret->out.get(), F_SETPIPE_SZ, &pipesize); + + return ret; }