mirror of
git://git.savannah.gnu.org/guix/maintenance.git
synced 2023-12-14 03:33:04 +01:00
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.
This commit is contained in:
parent
c23811e87f
commit
684d35276c
3 changed files with 10 additions and 13 deletions
|
@ -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"))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue