[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: nginx: mirror: Keep things in cache for 3 months.
From: |
Ludovic Courtès |
Subject: |
01/01: nginx: mirror: Keep things in cache for 3 months. |
Date: |
Wed, 16 Mar 2016 10:16:55 +0000 |
civodul pushed a commit to branch master
in repository maintenance.
commit 557c572f8a5f06be6fbb179e23d4820c9b846b69
Author: Ludovic Courtès <address@hidden>
Date: Wed Mar 16 11:15:52 2016 +0100
nginx: mirror: Keep things in cache for 3 months.
---
hydra/nginx/mirror-locations.conf | 8 ++++----
hydra/nginx/mirror.conf | 10 +++++++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/hydra/nginx/mirror-locations.conf
b/hydra/nginx/mirror-locations.conf
index 22b54d3..3e60d38 100644
--- a/hydra/nginx/mirror-locations.conf
+++ b/hydra/nginx/mirror-locations.conf
@@ -10,12 +10,12 @@ location = /index.html {
root /var/www;
}
-location /nix-cache-info {
+location = /nix-cache-info {
proxy_pass http://hydra.gnu.org/nix-cache-info;
# Cache this file since that's always the first thing we ask for.
proxy_cache static;
- proxy_cache_valid 200 10d; # cache hits for a looong time.
+ proxy_cache_valid 200 100d; # cache hits for a looong time.
proxy_cache_valid any 5m; # cache misses/others for 5 min.
proxy_ignore_client_abort on;
@@ -33,7 +33,7 @@ location /nar/ {
# Enable caching for nar files, to avoid reconstructing and recompressing
# archives.
proxy_cache nar;
- proxy_cache_valid 200 8d; # cache hits for 8 days.
+ proxy_cache_valid 200 91d; # cache hits for 3 months.
proxy_cache_valid any 1h; # cache misses/others for 1h.
proxy_ignore_client_abort on;
@@ -59,7 +59,7 @@ location ~ \.narinfo$ {
# Enable caching for narinfo files, to avoid recomputing nar signatures.
proxy_cache narinfo;
- proxy_cache_valid 200 7d; # cache hits for 7 days.
+ proxy_cache_valid 200 90d; # cache hits for 3 months.
proxy_cache_valid any 1h; # cache misses/others for 1h.
proxy_ignore_client_abort on;
diff --git a/hydra/nginx/mirror.conf b/hydra/nginx/mirror.conf
index 4c75c28..a1901ac 100644
--- a/hydra/nginx/mirror.conf
+++ b/hydra/nginx/mirror.conf
@@ -33,24 +33,28 @@ http {
keepalive_timeout 65;
+ # The 'inactive' parameter for caching is not very useful in our
+ # 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
+ inactive=90d # inactive keys removed after 90d
keys_zone=narinfo:8m # narinfo meta data: ~64K keys
max_size=4g; # total cache data size max
# cache for nar files
proxy_cache_path /var/cache/nginx/nar
levels=2
- inactive=7d # inactive keys removed after 7d
+ inactive=90d # inactive keys removed after 90d
keys_zone=nar:8m # nar cache meta data: ~64K keys
max_size=100g; # total cache data size max
# cache for static data
proxy_cache_path /var/cache/nginx/static
levels=1
- inactive=7d # inactive keys removed after 7 days
+ inactive=90d # inactive keys removed after 90d
keys_zone=static:1m # nar cache meta data: ~8K keys
max_size=2m; # total cache data size max