另一个是你的negative cache没有启用,如果你的这次穿透的请求里404 403啥的比较多的话,可以考虑启用这个:
#############################
# negative response caching #
#############################
CONFIG proxy.config.http.negative_caching_enabled INT 0
CONFIG proxy.config.http.negative_caching_lifetime INT 1800
再有就是多副本情况,建议你用http_ui看看cache中存储的这些内容,是不是多副本不够多造成的问题。可以考虑提高:
# The maximum number of alternates that are allowed for any given URL.
# It is not possible to strictly enforce this if the variable
# 'proxy.config.cache.vary_on_user_agent' is set to 1.
# The default value for 'proxy.config.cache.vary_on_user_agent' is 0.
# (0 disables the maximum number of alts check)
CONFIG proxy.config.cache.limits.http.max_alts INT 5
还有,如果你没有准确的expire时间的话,存储也可能成问题,建议看看调整:
# required headers: three options:
# 0 - No required headers to make document cachable
# 1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required
# 2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"
CONFIG proxy.config.http.cache.required_headers INT 2
再有就是多副本情况,建议你用http_ui看看cache中存储的这些内容,是不是多副本不够多造成的问题。可以考虑提高:
# The maximum number of alternates that are allowed for any given URL.
# It is not possible to strictly enforce this if the variable
# 'proxy.config.cache.vary_on_user_agent' is set to 1.
# The default value for 'proxy.config.cache.vary_on_user_agent' is 0.
# (0 disables the maximum number of alts check)
CONFIG proxy.config.cache.limits.http.max_alts INT 5
我把 proxy.config.cache.limits.http.max_alts 设为 20后穿透少了很多,但是还是有一小部分的穿透,难道20还不够大么
有点不理解ats的多副本,按照我的理解 如果是元素是可以压缩的,存两份就可以了:一份不压缩,一份压缩
多副本有什么意思呢
还有,如果你没有准确的expire时间的话,存储也可能成问题,建议看看调整:
# required headers: three options:
# 0 - No required headers to make document cachable
# 1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required
# 2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"
CONFIG proxy.config.http.cache.required_headers INT 2