简体   繁体   中英

Mongrel cluster and multi-applications problem

we're running in this issue. We're using a web service (using soap4r) to run some kind of searches and the problem appears when the webservice server is down and our aplication is trying to connect to it. At that point the application is unreachable, and all the customers are blocked.

What can we do to avoid that? Is possibile to block the routing to a mongrel that it is blocked? (I suppose that the apache's proxy uses a round-robin algohritm)

Thanks Roberto

在我看来,这可能不是mod_proxy问题,而不是Mongrel或Apache问题-您是否按此处所述设置代理超时?

Use mod_rewrite to reurn an error page that is more useful to the web service clients than Apache's proxy timeout errors. For example this Apache configuration will render maintence.html if it exists. So all you have to do is drop the file in and the server is automatically in maintence mode.

# 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]

You could make it an XML file set up with the appropriate conent types that makes the static file look like a web service response that is essentially "please wait 10 minutes and try again", possibly with a configurable wait time.

Capistrano's web:disable task may be helpful to you, as it takes an argument for how long the site will be unavailable and puts that in the HTML when it generates the maintence.html file.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM