php 错误 503 后端提取失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30068729/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 21:31:50  来源:igfitidea点击:

Error 503 Backend fetch failed

phpruntime-errorvarnishvarnish-vclhttp-status-code-503

提问by WebDeveloper

I have this error in my site

我的网站有这个错误

Error 503 Backend fetch failed

Backend fetch failed

Guru Meditation:

XID: 526707

Varnish cache server

错误 503 后端提取失败

后端提取失败

上师冥想:

编号:526707

优化缓存服务器

Anyone know what may be the cause or how to find out what happens?

任何人都知道可能是什么原因或如何找出发生了什么?

回答by moebin

There's a common reason that varnish returns 503 that is not explained on the varnish error list. I have learnt this from experience.

varnish 返回 503 的一个常见原因在 varnish 错误列表中没有解释。我从经验中学到了这一点。

If your web server is returning 500 error or similar then varnish simply says Error 503 Backend fetch failed.

如果您的 Web 服务器返回 500 错误或类似错误,那么 varnish 只会说 Error 503 Backend fetch failed。

what you need to do is to always try to fetch without varnish to see if the error is in varnish or the web server. For example if you have a different hostname for the webserver, load that and find the error, if you fix that, then restart varnish and that solves it most of the time.

您需要做的是始终尝试在不使用清漆的情况下进行获取,以查看错误是在清漆中还是在 Web 服务器中。例如,如果您的网络服务器有一个不同的主机名,请加载它并找到错误,如果您修复它,然后重新启动 varnish 并在大多数情况下解决它。

回答by crico_aven

That means that Varnish has been properly configured to accept incoming connections, but is not yet available to serve your backend. This error is common when varnish receives a request but your backend is still restarting/releasing.

这意味着 Varnish 已正确配置为接受传入连接,但尚无法为您的后端提供服务。当 varnish 收到请求但您的后端仍在重新启动/释放时,此错误很常见。

回答by harri

This can be due to the length of cache tags used by Magento exceeding Varnish's default of 8192 bytes.

这可能是由于 Magento 使用的缓存标签长度超过了 Varnish 的默认值 8192 字节。

This can be solved by modifying the varnish configs:

这可以通过修改清漆配置来解决:

  • CentOS 6: /etc/sysconfig/varnish
  • CentOS 7: /etc/varnish/varnish.params
  • Ubuntu: /etc/default/varnish
  • CentOS 6:/etc/sysconfig/varnish
  • CentOS 7:/etc/varnish/varnish.params
  • Ubuntu:/etc/default/varnish

Find http_resp_hdr_len. If the parameter doesn't exist, add it after thread_pool_max.

找到http_resp_hdr_len。如果该参数不存在,则将其添加到thread_pool_max之后。

Magento suggests setting http_resp_hdr_lento a value equal to the product count of your largest category multiplied by 21.

Magento 建议将http_resp_hdr_len设置等于您最大类别的产品数量乘以 21 的值。

For example, setting the value to 65536 bytes should work if your largest category has 3,000 products:

例如,如果您最大的类别有 3,000 个产品,则将值设置为 65536 字节应该可以工作:

-p http_resp_hdr_len=65536 \

See here: http://devdocs.magento.com/guides/v2.0/config-guide/varnish/tshoot-varnish-503.html

请参阅此处:http: //devdocs.magento.com/guides/v2.0/config-guide/varnish/tshoot-varnish-503.html