Skip to content

Network errors with ncps behind nginx #990

@gepbird

Description

@gepbird

Since #806 ncps is working well, mostly. Well it's not an issue with ncps itself but other software or hardware around it.

Sometimes when building many packages on a host that uses my ncps server (config) that send many requests to my ncps server, Lix reports various errors and fails. My last 4 attempts of nixpkgs-review pr 494320 failed with these errors:

Removing ncps cache for the above build worked first try: nixpkgs-review pr 494320 --build-args='--substituters "https://cache.nixos.org"'.

My questions are:

  • What is the recommended configuration for hosting ncps with nginx? (Should I add some extra nginx config, try angie, try other webservers, move this to a beefier machine/cloud which I don't really want...) Maybe an example config to serve it with a domain would be worth mentioning at https://docs.ncps.dev/user-guide/installation/nixos.
  • Can I make the client tolerate/retry these "one-off" errors, should I try other clients? I've had similar issues in the past with Lix.

Edit: the second issue could be solved by bumping some nginx worker connections, I'm not sure how good or bad idea is that. Logs:

Feb 26 12:19:34 raspi5-doboz nginx[204246]: 2026/02/26 12:19:34 [alert] 204246#204246: *110482 512 worker_connections are not enough while connecting to upstream, client: 89.148.88.60, server: nix-cache.tchfoo.com, request: "GET /jwp524w5r58j2w4s7kxhk53cxsv1qzqc.narinfo HTTP/2.0", upstream: "http://[::1]:8501/jwp524w5r58j2w4s7kxhk53cxsv1qzqc.narinfo", host: "nix-cache.tchfoo.com"
Feb 26 12:19:34 raspi5-doboz nginx[204246]: 2026/02/26 12:19:34 [alert] 204246#204246: 512 worker_connections are not enough

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions