[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: nginx: hydra.gnu.org: Disable narinfo caching altogether.
From: |
Ludovic Courtès |
Subject: |
01/01: nginx: hydra.gnu.org: Disable narinfo caching altogether. |
Date: |
Fri, 21 Jul 2017 05:02:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit ebbe4c7f402b6d9cf9c6c2ecf120f49697ab2c49
Author: Ludovic Courtès <address@hidden>
Date: Wed Jul 19 21:56:35 2017 +0200
nginx: hydra.gnu.org: Disable narinfo caching altogether.
Somehow nginx appeared to be caching narinfos for longer than needed,
which defeated the atime-based cache eviction strategy of 'guix
publish'.
* hydra/nginx/hydra.gnu.org-locations.conf (\.narinfo): Remove
"proxy_cache" directives.
* hydra/nginx/hydra.gnu.org.conf: Remove 'proxy_cache_path' directive
for narinfos.
---
hydra/nginx/hydra.gnu.org-locations.conf | 14 +++++---------
hydra/nginx/hydra.gnu.org.conf | 7 -------
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/hydra/nginx/hydra.gnu.org-locations.conf
b/hydra/nginx/hydra.gnu.org-locations.conf
index 5b417f5..32f0c9b 100644
--- a/hydra/nginx/hydra.gnu.org-locations.conf
+++ b/hydra/nginx/hydra.gnu.org-locations.conf
@@ -114,6 +114,11 @@ location ~ /(nix-cache-info|static|logo|favicon\.ico) {
location ~ \.narinfo$ {
# Narinfos served by 'guix publish' (see above). If we change the
# port to 3000, then they are served by Hydra.
+ #
+ # Since 'guix publish' has its own caching, and since it relies on
+ # the atime of cached narinfos to determine whether a narinfo can
+ # be removed from the cache, don't do any caching here. (Hydra
+ # computed narinfos on the fly so it definitely needed caching.)
proxy_pass http://127.0.0.1:9999;
# For HTTP pipelining. This has a dramatic impact on performance.
@@ -127,15 +132,6 @@ location ~ \.narinfo$ {
proxy_read_timeout 6s;
proxy_send_timeout 6s;
- # Enable caching for narinfo files, to avoid recomputing nar signatures.
- # 'guix publish' has its own cache and uses the narinfo atime to
- # determine whether a narinfo can be removed from the cache; thus
- # choose a validity that is shorter than 'guix publish --ttl'.
- proxy_cache narinfo;
- proxy_cache_valid 200 5d; # cache hits for 5 days
- proxy_cache_valid 504 2m; # timeout, when hydra.gnu.org is overloaded
- proxy_cache_valid any 1m; # cache misses/others for 1 min.
-
# 'guix publish --ttl' produces a 'Cache-Control' header for use
# by 'guix substitute'. Let it through rather than use nginx's
# "expire" directive since the expiration time defined by 'guix
diff --git a/hydra/nginx/hydra.gnu.org.conf b/hydra/nginx/hydra.gnu.org.conf
index 2afc838..9cf5e15 100644
--- a/hydra/nginx/hydra.gnu.org.conf
+++ b/hydra/nginx/hydra.gnu.org.conf
@@ -46,13 +46,6 @@ http {
# Since 'guix publish' has its own cache, allocate little room for
# nginx's own cache.
- # cache for narinfo files
- proxy_cache_path /var/cache/nginx/narinfo
- levels=2
- inactive=7d # inactive keys removed after 7d
- keys_zone=narinfo:4m # narinfo meta data: ~32K keys
- max_size=5g; # total cache data size max
-
# cache for nar files
proxy_cache_path /var/cache/nginx/nar
levels=2