From 81b02e07a4f4ebdbecb2ff076310a9eedc662272 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 8 Nov 2017 09:41:01 +1100 Subject: [PATCH] Make the cache perform better on errors Turn on cachestoreexpired for all mirrors (this was already enabled for the 8081 mirror). Also, set the retry time to 0s so that if a backend error occurs, we attempt to retry immediately, rather than disabling the backend for 60s. Change-Id: Ibbb6461eff977c0e6dcf10ac4e5eb49e490bccd4 --- .../templates/mirror.vhost.erb | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/openstack_project/templates/mirror.vhost.erb b/modules/openstack_project/templates/mirror.vhost.erb index dfbe54a461..93b6d05071 100644 --- a/modules/openstack_project/templates/mirror.vhost.erb +++ b/modules/openstack_project/templates/mirror.vhost.erb @@ -130,6 +130,7 @@ NameVirtualHost <%= @vhost_name %>:8081 CacheLockMaxAge 5 # 5GiB CacheMaxFileSize 5368709120 + CacheStoreExpired On # Added Aug 2017 in an attempt to avoid occasional 502 errors (around # 0.05% of requests) of the type: @@ -151,47 +152,47 @@ NameVirtualHost <%= @vhost_name %>:8081 # buildlogs.centos.org (302 redirects to buildlogs.cdn.centos.org) CacheEnable disk "/buildlogs.centos" - ProxyPass "/buildlogs.centos/" "https://buildlogs.centos.org/" ttl=120 disablereuse=On + ProxyPass "/buildlogs.centos/" "https://buildlogs.centos.org/" ttl=120 disablereuse=On retry=0 ProxyPassReverse "/buildlogs.centos/" "https://buildlogs.centos.org/" # buildlogs.cdn.centos.org CacheEnable disk "/buildlogs.cdn.centos" - ProxyPass "/buildlogs.cdn.centos/" "https://buildlogs.cdn.centos.org/" ttl=120 disablereuse=On + ProxyPass "/buildlogs.cdn.centos/" "https://buildlogs.cdn.centos.org/" ttl=120 disablereuse=On retry=0 ProxyPassReverse "/buildlogs.cdn.centos/" "https://buildlogs.cdn.centos.org/" # rdo CacheEnable disk "/rdo" - ProxyPass "/rdo/" "https://trunk.rdoproject.org/" ttl=120 keepalive=On + ProxyPass "/rdo/" "https://trunk.rdoproject.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/rdo/" "https://trunk.rdoproject.org/" # tarballs CacheEnable disk "/tarballs" - ProxyPass "/tarballs/" "https://tarballs.openstack.org/" ttl=120 keepalive=On + ProxyPass "/tarballs/" "https://tarballs.openstack.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/tarballs/" "https://tarballs.openstack.org/" # pypi CacheEnable disk "/pypi" - ProxyPass "/pypi/" "http://mirror.dfw.rax.openstack.org/pypi/" ttl=120 keepalive=On + ProxyPass "/pypi/" "http://mirror.dfw.rax.openstack.org/pypi/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/pypi/" "http://mirror.dfw.rax.openstack.org/pypi/" # images.linuxcontainers.org CacheEnable disk "/images.linuxcontainers" - ProxyPass "/images.linuxcontainers/" "http://us.images.linuxcontainers.org/" ttl=120 keepalive=On + ProxyPass "/images.linuxcontainers/" "http://us.images.linuxcontainers.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/images.linuxcontainers/" "http://us.images.linuxcontainers.org/" # registry.npmjs.org CacheEnable disk "/registry.npmjs" - ProxyPass "/registry.npmjs/" "https://registry.npmjs.org/" ttl=120 keepalive=On + ProxyPass "/registry.npmjs/" "https://registry.npmjs.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/registry.npmjs/" "https://registry.npmjs.org/" # api.rubygems.org CacheEnable disk "/api.rubygems" - ProxyPass "/api.rubygems/" "https://api.rubygems.org/" ttl=120 keepalive=On + ProxyPass "/api.rubygems/" "https://api.rubygems.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/api.rubygems/" "https://api.rubygems.org/" # rubygems.org CacheEnable disk "/rubygems" - ProxyPass "/rubygems/" "https://rubygems.org/" ttl=120 keepalive=On + ProxyPass "/rubygems/" "https://rubygems.org/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/rubygems/" "https://rubygems.org/" @@ -238,12 +239,12 @@ NameVirtualHost <%= @vhost_name %>:8081 # registry-1.docker.io CacheEnable disk "/registry-1.docker" - ProxyPass "/registry-1.docker/" "https://registry-1.docker.io/" ttl=120 keepalive=On + ProxyPass "/registry-1.docker/" "https://registry-1.docker.io/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/registry-1.docker/" "https://registry-1.docker.io/" # dseasb33srnrn.cloudfront.net CacheEnable disk "/cloudfront" - ProxyPass "/cloudfront/" "https://dseasb33srnrn.cloudfront.net/" ttl=120 keepalive=On + ProxyPass "/cloudfront/" "https://dseasb33srnrn.cloudfront.net/" ttl=120 keepalive=On retry=0 ProxyPassReverse "/cloudfront/" "https://dseasb33srnrn.cloudfront.net/"