davidself
猫哥
CJSDN高级会员
发贴: 1506
积分: 333
|
于 2004-06-29 17:25
可参考"Professional Apache Tomcat 5" 19章
Tomcat 5 also includes an application-level load-balancing front-end mechanism called the balancer Web application. The balancer uses rules-based URL rewriting to redirect incoming requests. This is best used in a standalone mode configuration (that is, without an Apache front end), and is very effective for initial incoming request redirection. Its routing decisions can be made with the help of custom-coded rules, optionally taking into account dynamic system information (server loads and time of day, and so on).
The balancer uses a distinctly different means to balance the load: It redirects the incoming URL. The balancer performs the following steps: 1. Incoming URL requests are directed to the balancer Web application according to the URL pattern specified in the deployment descriptor’s (web.xml) <filter-mapping> definition. 2. The balancer then examines the intercepted incoming URL and applies its chain of rules to it. The rules are configured in the rules.xml file. 3. When a rule is matched against a URL, the associated redirect URL is sent back to the browser. 4. The browser now attempts to access the new URL.
Note the following two main points: ❑ Each redirection requires an extra round-trip as the browser receives the redirection and connects to the new URL. ❑ This scheme is effective only for an initial request redirect, unless there exists a rule for dynamically generating the redirect URL (based on portion of the original incoming URL). The second point is important because in the current version of the balancer application (Tomcat 5.0.16 as of this writing), the balancer cannot redirect to a dynamically created URL.
davidself edited on 2004-06-29 17:30
--108的上铺-- davidself@twitter
|