Repository navigation
ssh-ng client ~66× slower than upstream nix 2.34.7 for closure copies (per-path connection reopen) #533
Description
Activity
This is fixed in #538 (which should be in the next release). However, it will require upgrading both the client and the server.
- added a commit that references this issue
on Jul 9, 2026 However, it will require upgrading both the client and the server.
Does this mean DetNix is now incompatible with upstream Nix? DetNix v3.21.5 hangs for me when copying a large derivation to a Nix v2.34.7 host.
Does this mean DetNix is now incompatible with upstream Nix? DetNix v3.21.5 hangs for me when copying a large derivation to a Nix v2.34.7 host.
Yes. Unless DetNix adds a fallback mode, the best answer I've found is to just use nixpkgs#nix for those operations.
Unless DetNix adds a fallback mode
It uses
featureAddTempRootsprotocol-level feature flag, so it should work, and it works for meThe fallback is here:
https://github.com/DeterminateSystems/nix-src/pull/538/changes#diff-9338f330e24f13e71e33fcd53698bb563f916fb823331f0484c1a1674974e896R703-R715It uses
featureAddTempRootsprotocol-level feature flag, so it should work, and it works for mefeatureAddTempRoots is already in v3.21.5, but it's protocol-negotiated — against an upstream nix 2.34.7 server it falls back to the per-path path, which on a large closure over high latency is the "hang" I'm seeing.
Unless I'm doing something wrong, that doesn't help until upstream ships the batched op server-side. If I'm missing something obvious, please let me know!
Reacted by Simon ŽlenderYeah, to me it looks like the fallback is to the regressed slow path. So right now it's not usable for managing upstream NixOS hosts.
Edit: It's been more than a month that I've been unable to manage NixOS hosts with Determinate Nix. At this point it looks like there's very little interest in maintaining compatibility with upstream Nix, and as such I've migrated all my machines back to upstream Nix. Good bye.
@edolstra : can we reopen this since other users will likely keep hitting this issue?
Reacted by Simon ŽlenderI don't understand what we're supposed to do now when using Determinate Nix. It's not like Determinate makes it easy to maintain Determinate Nix on NixOS hosts. It's not packaged for
nixpkgsnor as a downstream flake package. The official suggestion is to manually install it on every single host, and then manually maintain it, ironically making Nix the only package not managed through Nix.I think at this point I'd rather just use upstream Nix which has none of these problems.
Reacted by Simon Žlender- added a commit that references this issue
on Aug 3, 2026 We've dropped the registering of remote roots when talking to a daemon that doesn't support efficient remote root registration (#598). This will be included in the next release.
- added a commit that references this issue
on Aug 26, 2026
Describe the bug
Copying a derivation closure to an
ssh-ng://store with Determinate Nix 3.21.2 (nix 2.34.7) is drastically slower than doing the identical copy with upstream nix 2.34.7 — the same nix version. Thessh-ngclient reopens the SSH connection per path during the valid-paths /narFromPathhandshake, so the cost scales with the number of paths in the closure rather than the bytes transferred, even when nothing needs to be transferred.Because upstream 2.34.7 is fast and Determinate 2.34.7 is ~66× slower on the same operation, this looks like a fork-specific regression rather than a missing upstream fix — most likely in Determinate's SinkToSource /
narFromPathcoroutine connection-handling patches (e.g.a51e93ad,034fe11d), which touch the same area upstream addressed in NixOS/nix#6950 / PR #14998 ("Do not mark connections as bad whenRemoteStore::narFromPathis called as a coroutine").Practical impact:
deploy-rs --remote-build(which copies the system derivation closure overssh-ng) stalls for 15+ minutes in the handshake on a ~5000-path NixOS system closure, appearing hung. Regular deploys usessh://and are unaffected.Steps to reproduce
Pick a large derivation closure the destination already has (so 0 paths transfer), and copy it over both store types:
Measurements
Same 5100-path closure, already present on the destination (0 paths copied), same host/link:
ssh://ssh-ng://nixpkgs#nix2.34.7,ssh-ng://So it is specific to the Determinate
ssh-ngclient — upstream nix of the same version (2.34.7) does the identicalssh-nghandshake in ~8 s. strace shows the client blocking ~1 s per path, and (with an SSH agent) a signing round-trip per path, consistent with a connection reopen pernarFromPathcoroutine call.Workaround: run deploys with upstream nix in
PATH(nix shell nixpkgs#nix -c deploy --remote-build ...) — 38 s end-to-end vs 25+ min.Expected behavior
Determinate's
ssh-ngclient should match upstream nix 2.34.7: do the valid-paths negotiation in one batched round-trip (likessh://) instead of reopening the connection per path.Metadata
Likely related: #441 (ssh-ng fails with SSH ControlMaster multiplexing) — same connection-handling layer.