aristanetworks / nix-serve-ng

A drop-in replacement for nix-serve that is faster and more reliable
Other
156 stars 14 forks source link

Timeouts #8

Open angerman opened 2 years ago

angerman commented 2 years ago

Hi there! Thanks for building nix-serve-ng. If you permit, let me pick your brains a bit. With nix-serve-ng, I'm seeing much less of

upstream timed out (110: Connection timed out) while reading response header from upstream

than I saw with nix-serve, where it was almost a constant stream of time outs.

Is there a way nix-serve-ng could report response times per request somehow? I'm not sure I fully trust nginx not to screw something up somewhere in the pipeline.

Another idea I had--though this might be completely misguided--is it possible that the sqlite database has too much contention? I would assume that reads are done concurrently. However if there are writes happening at the same time, and this means the DB blocks a read for a while, this might explain the time outs?

Gabriella439 commented 1 year ago

I believe we do support per-request timeouts. See:

https://github.com/aristanetworks/nix-serve-ng/blob/5e0e4fb8ab22af0aa8ce99d3b1c32f33bc9f9337/src/Options.hs#L132-L141