2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/maintenance.git synced 2023-12-14 03:33:04 +01:00

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.
This commit is contained in:
Ludovic Courtès 2017-07-19 21:56:35 +02:00
parent 2de3212522
commit ebbe4c7f40
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 5 additions and 16 deletions

View file

@ -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

View file

@ -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