guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: nginx: berlin: Disable narinfo caching altogether.


From: Ludovic Courtès
Subject: 01/01: nginx: berlin: Disable narinfo caching altogether.
Date: Thu, 21 Jun 2018 05:44:39 -0400 (EDT)

civodul pushed a commit to branch master
in repository maintenance.

commit 8379ba4119e51151d93589a6ef57cb159d94e9f2
Author: Ludovic Courtès <address@hidden>
Date:   Thu Jun 21 11:41:06 2018 +0200

    nginx: berlin: Disable narinfo caching altogether.
    
    This is a followup to ebbe4c7f402b6d9cf9c6c2ecf120f49697ab2c49.
    
    * hydra/nginx/berlin-locations.conf (.narinfo): Disable caching.
    * hydra/nginx/berlin.conf: Remove 'proxy_cache_path' directive
    for narinfos.
---
 hydra/nginx/berlin-locations.conf | 13 +++----------
 hydra/nginx/berlin.conf           |  7 -------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/hydra/nginx/berlin-locations.conf 
b/hydra/nginx/berlin-locations.conf
index 85c1bf6..11171f7 100644
--- a/hydra/nginx/berlin-locations.conf
+++ b/hydra/nginx/berlin-locations.conf
@@ -65,6 +65,9 @@ location /nar/ {
 }
 
 location ~ \.narinfo$ {
+    # 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.
     proxy_pass http://localhost:3000;
 
     # For HTTP pipelining.  This has a dramatic impact on performance.
@@ -79,16 +82,6 @@ location ~ \.narinfo$ {
     proxy_read_timeout 2s;
     proxy_send_timeout 2s;
 
-    # Enable caching for narinfo files, to avoid recomputing nar signatures.
-    #
-    # Note: Avoid caching narinfos for too long to avoid a situation
-    # where we have the narinfo but don't have the corresponding nar
-    # and cannot have it.
-    proxy_cache narinfo;
-    proxy_cache_valid 200 7d;   # cache hits for 1 week
-    proxy_cache_valid 504 5m;  # timeout, when hydra.gnu.org is overloaded
-    proxy_cache_valid any 2m;   # cache misses/others for 2m
-
     # '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/berlin.conf b/hydra/nginx/berlin.conf
index fbeffe0..3799bb2 100644
--- a/hydra/nginx/berlin.conf
+++ b/hydra/nginx/berlin.conf
@@ -48,13 +48,6 @@ http {
     # case: all that matters is that LRU sweeping happens when
     # 'max_size' is hit.
 
-    # 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=1g;          # total cache data size max
-
     # cache for nar files
     proxy_cache_path /var/cache/nginx/nar
                     levels=2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]