[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: hydra: bayfront: Use 'guix publish --cache'.
From: |
Ludovic Courtès |
Subject: |
01/01: hydra: bayfront: Use 'guix publish --cache'. |
Date: |
Wed, 19 Apr 2017 12:02:38 -0400 (EDT) |
civodul pushed a commit to branch master
in repository maintenance.
commit 684d35276cf7649fdc3581b02fd6d49abbb73b14
Author: Ludovic Courtès <address@hidden>
Date: Wed Apr 19 17:58:44 2017 +0200
hydra: bayfront: Use 'guix publish --cache'.
* hydra/bayfront.scm (services): Use the 'cache' and 'ttl' options of
'guix-publish-service-type'.
* hydra/nginx/bayfront.conf,
hydra/nginx/bayfront-locations.conf: Cache narinfos and nars for a
shorter period; allocate less space for these caches.
---
hydra/bayfront.scm | 6 +++++-
hydra/nginx/bayfront-locations.conf | 13 +++----------
hydra/nginx/bayfront.conf | 4 ++--
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index 3ca369b..5470d5c 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -186,7 +186,11 @@ Happy hacking!\n"))
(lsh-service #:port-number 22)
;; The Web service.
- (guix-publish-service #:port 3000)
+ (service guix-publish-service-type
+ (guix-publish-configuration
+ (port 3000)
+ (cache "/var/cache/guix/publish")
+ (ttl (* 14 24 3600))))
(nginx-service #:config-file
(file-append %nginx-config
"/bayfront.conf"))
diff --git a/hydra/nginx/bayfront-locations.conf
b/hydra/nginx/bayfront-locations.conf
index 3daa8d1..3873e40 100644
--- a/hydra/nginx/bayfront-locations.conf
+++ b/hydra/nginx/bayfront-locations.conf
@@ -37,7 +37,7 @@ location /nar/ {
# Enable caching for nar files, to avoid reconstructing and recompressing
# archives.
proxy_cache nar;
- proxy_cache_valid 200 91d; # cache hits for 3 months.
+ proxy_cache_valid 200 30d; # cache hits for 1 month
proxy_cache_valid 504 3m; # timeout, when hydra.gnu.org is overloaded
proxy_cache_valid any 1h; # cache misses/others for 1h.
@@ -74,20 +74,13 @@ location ~ \.narinfo$ {
# where we have the narinfo but don't have the corresponding nar
# and cannot have it.
proxy_cache narinfo;
- proxy_cache_valid 200 30d; # cache hits for 1 month
+ 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 1h; # cache misses/others for 1h.
+ proxy_cache_valid any 2m; # cache misses/others for 2m
# Use the above TTLs, not those advertised by hydra.gnu.org.
proxy_ignore_headers Expires Cache-Control;
- # Add 'Expires' and 'Cache-Control' response headers so clients
- # such as 'guix substitute' know how long they can cache it.
- # Override the headers coming from hydra.gnu.org.
- proxy_hide_header Expires;
- proxy_hide_header Cache-Control;
- expires 7d;
-
proxy_ignore_client_abort on;
# We need to hide and ignore the Set-Cookie header
diff --git a/hydra/nginx/bayfront.conf b/hydra/nginx/bayfront.conf
index 46d49f9..6fff6ca 100644
--- a/hydra/nginx/bayfront.conf
+++ b/hydra/nginx/bayfront.conf
@@ -51,14 +51,14 @@ http {
levels=2
inactive=7d # inactive keys removed after 7d
keys_zone=narinfo:4m # narinfo meta data: ~32K keys
- max_size=20g; # total cache data size max
+ max_size=5g; # total cache data size max
# cache for nar files
proxy_cache_path /var/cache/nginx/nar
levels=2
inactive=8d # inactive keys removed after 8d
keys_zone=nar:4m # nar cache meta data: ~32K keys
- max_size=200g; # total cache data size max
+ max_size=50g; # total cache data size max
# cache for content-addressed files
proxy_cache_path /var/cache/nginx/cas