Nix-serve-ng: A faster, more reliable, drop-in replacement for nix-serve

Our team at Arista Networks created a nix-serve rewrite to help scale out our internal deployment by improving performance and reliability

You will most likely be interested in this project if you’re a large-scale deployment of Nix that relies on a nix-serve in some capacity, but you can also try it out for personal use, too.

You can find a more detailed announcement post here:

You can also find the GitHub repository here:

10 Likes

Nice work!

You’re serving your company cache from a big disk?

Nice! I’ll try to use it in peerix (a local p2p store), this is very important as nix-serve is too slow, especially on old workstations.

1 Like

Yes. We still haven’t switched to pushing cache products to, say, S3 to serve them, so we make our main build server’s cache available

1 Like

Thx for the inspiration. I also implemented nar streaming using libnix now in harmonia as well: stream nar without nix-store --dump by Mic92 · Pull Request #30 · helsinki-systems/harmonia · GitHub

2 Likes

How does this compare with nix-serve + a reverse proxy? I found a decent improvement in performance from serving off out hydra machine when I added nginx in front of it to manage the actual streaming of content over the wire. Would be great to know what additional gains may be possible on top of that.

1 Like

The main difference would most likely be for accuracy and disk utilization. Any caching that nginx performs would decrease the accuracy of the lookup (especially if it caches negative lookups, which are the most common type of lookup). Also, anything that nginx caches has to be duplicated on disk, which means that if you garbage collect the build product you would only remove one copy (out of two).

it’s also not possible (or not without efforts) to push packages to a local nginx cache