Adding the vmroute may help with load balancing, but it doesn't help with fail-over. What happens when the tomcat instance that created a session goes down, and then the user sends another request? It should be routed to 'another' tomcat in the cluster. This 'other' tc instance should probably become the new 'owner' of the session. All subsequent requests for that session should be routed to the new owner (until / unless the new owner goes down).
One simple solution is to simply keep track of the 'vmroute's that are 'down' or no longer available and substitue each down vm with one other vm in the cluster. Anytime a request is received from a client that is destined for one of the 'down' vm's, Apache can route the request to the 'stand-in' vm instead. The obvious disadvantage is that it will unfairly burden the 'stand-in' vm's, which may have already been handling their fair share of traffic. This, does provide fail-over. Which, is an important feature to have for ha environments. Another solution would be to calculate some sort of checksum on each session id received for a vm that is no longer on the air. Then modulo that number by the number of available tc instances in the cluster, and route the request to the the jth server in the cluster (where j is the calculated modulo). This would spread the load without requiring anyone to start maintaining copious session routing tables. I don't know what you'd do if the number of available tc's changes. Another solution would be to send a cookie back to the client that contains the new jvmrouting info. But, that only works for clients that allow cookies. Another solution would be to choose a new 'owner', and store this mapping (of session id to owner vm) in a hashtable. Then, in subsequent requests, do a hashtable lookup to find the owner vm. Solutions that require a large routing table are probably not desirable, but would probably result in the greatest flexibility. Tom Drake ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "Tomcat Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, December 18, 2001 2:14 PM Subject: Re: Load balancing - fail-over support with mod_webapp | On Tue, 18 Dec 2001, Craig R. McClanahan wrote: | | > The load balancer routing from JK hasn't ever been implemented in | > Catalina yet. Patches welcome :-). | | Can we get a 'setRequest' method on Manager ? I'm trying to find | workarounds, but that would be the simple solution. | | Again, adding support for load balancer is simple - the Manager just need | to append the vmroute to the generated session id. How you get the session | id is the problem - it is available in request, or it could be configured | in server.xml if getting from the request is not possible. | | ( right now I'm trying to finish jk2 asap - when I'm done I'll try again | to fix the lb for 40 if nobody does it before ) | | Costin | | | -- | To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> | For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> | | | -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>