2

我们正在处理这个问题。我们正在使用网络服务(使用soap4r)来运行某种搜索,当网络服务服务器关闭并且我们的应用程序试图连接到它时,问题就会出现。此时应用程序无法访问,并且所有客户都被阻止。

我们能做些什么来避免这种情况?是否有可能阻止到它被阻止的杂种的路由?(我想apache的代理使用循环算法)

谢谢罗伯托

4

3 回答 3

1

在我看来,这可能更像是一个 mod_proxy 问题,而不是 Mongrel 或 Apache 的问题——您是否按照此处所述设置代理超时?

于 2008-10-09T16:04:41.840 回答
0

使用 mod_rewrite 重新生成对 Web 服务客户端比 Apache 的代理超时错误更有用的错误页面。例如,此 Apache 配置将呈现maintence.html(如果存在)。因此,您只需将文件放入其中,服务器就会自动处于维护模式。

# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]

您可以将其设置为使用适当的内容类型设置的 XML 文件,使静态文件看起来像 Web 服务响应,本质上是“请等待 10 分钟,然后重试”,可能具有可配置的等待时间。

Capistrano 的web:disable 任务可能对您有所帮助,因为它需要一个参数来确定站点将在多长时间内不可用,并在生成maintence.html文件时将其放入 HTML 中。

于 2008-10-12T16:46:46.983 回答
0

You need to put a timeout on your Soap4R requests. Set the connect_timeout attribute to something rather small. This should cause an exception to be handled in your code and not just leave the requests hanging.

You should also make sure your timeouts are set in your mod_proxy_balancer config.

于 2008-10-14T17:47:56.063 回答