!RROtHmAaQIkiJzJZZE:nixos.org

NixOS Infrastructure

352 Members
Next Infra call: 2024-07-11, 18:00 CEST (UTC+2) | Infra operational issues backlog: https://github.com/orgs/NixOS/projects/52 | See #infra-alerts:nixos.org for real time alerts from Prometheus.109 Servers

Load older messages


SenderMessageTime
10 Jul 2025
@fr0de_0xa:matrix.orgFred Lahde joined the room.18:47:41
@arianvp:matrix.orgArianYeh so stuff is really off: https://cache.nixos.org/h35hs85vd5nhrzv3j03ybdfz2s1wsc6l.narinfo (200) takes between 20ms and 90ms to resolve for me https://cache.nixos.org/lolno.narinfo (404) takes consistently between 120 and 230ms for me so we are not caching 404s and they're really slow18:51:27
@arianvp:matrix.orgArian

And looking at the generated VCL I indeed think we can fix it by changing cache_condition to response_condition

the cache_condition gets executed before a hit/miss is decided. This means that we return the fixed 404 response before varnish even makes decision on whether to cache or not and exits out of the VCL

18:52:29
@arianvp:matrix.orgArianso we never hit the code-path for caching18:52:33
@arianvp:matrix.orgArian"How I made `nixos-rebuild switch 200% faster for everyone with this one weird trick"18:53:14
@arianvp:matrix.orgArianI just need to know if this was deliberately set up like this. Are we on purpose not caching 404s or by accident?18:53:29
@jfly:matrix.orgJeremy Fleischman (jfly)It sure looks like the intent was to cache 404s. Here's the initial import into terraform, which has the "cache 404s" code: https://github.com/NixOS/infra/commit/ee995c5f3fee6d645a4a8fb9a93c57f3763b9f07#diff-75e932ae3525435283fff74680b6af8d8c83df93a23b10c7f0a9fcf0a6e4f3e9R179-R18418:56:46
@arianvp:matrix.orgArianyeh so it actually does the opposite. 404s are cached by default by fastly and this breaks that :D18:57:08
@jfly:matrix.orgJeremy Fleischman (jfly)i say, go delete some code18:57:40
@arianvp:matrix.orgArian well I think we still maybe want to replace the 404 payload with the string 404 otherwise we get some ugly XML blob from S3 18:58:31
@arianvp:matrix.orgArianbut we should do it later in the VCL 18:58:39
@zhaofeng:zhaofeng.liZhaofeng Liwait, do we have some kind of post-build-hook/s3 hook/etc to bust the cache after paths are built?18:59:03
@emilazy:matrix.orgemilyare you saying every Nix build in the universe is way slower than it should be because it's hitting S318:59:32
@arianvp:matrix.orgArianyes18:59:37
@emilazy:matrix.orgemily(…does S3 bill for 404s?)18:59:39
@arianvp:matrix.orgArianYes S3 bills for 404s18:59:46
@emilazy:matrix.orgemilylol18:59:49
@arianvp:matrix.orgArianthey even used to bill for authorization errors so you could just rack up anyone's bill by knowing their bucket name19:00:02
@arianvp:matrix.orgArianthey changed that now19:00:04
@emilazy:matrix.orgemilyplease run some numbers on how much of the cache size bill this is, I'm so curious19:00:13
@jfly:matrix.orgJeremy Fleischman (jfly)no, but the intent is to "only" cache 404s for 24 hours19:00:14
@arianvp:matrix.orgArianI have these numbers. I don't think API Calls are a large portion of our cost19:00:36
@emilazy:matrix.orgemilythat might not be great UX: the channel scripts run to bump channels after the final builds complete19:00:41
@emilazy:matrix.orgemily so anyone who has been running master before that will have cached 404s for first day everyone is bumping to the new channel revision 19:00:58
@zhaofeng:zhaofeng.liZhaofeng Licontributors can try to build locally and trigger the negative caching, which would be bad UX19:01:07
@zhaofeng:zhaofeng.liZhaofeng Liyeah19:01:10
@arianvp:matrix.orgArianBut this is already a problem. Nix caches 404s locally19:01:18
@emilazy:matrix.orgemilyit's not a problem across users19:01:25
@zhaofeng:zhaofeng.liZhaofeng Libut this would affect it for everyone19:01:29
@emilazy:matrix.orgemily most users don't try to run master, but some do 19:01:30

Show newer messages


Back to Room ListRoom Version: 6