tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Load balancing app context ?
Date Sun, 10 Feb 2002 21:35:00 GMT
On Sun, Feb 10, 2002 at 03:04:40PM -0600, Jose Solorzano wrote:
> Yes, it does sound kind of weird :)
> You could simply use sockets for the initial connection. That way you
> won't need at least one blocked HttpConnector thread for each active
> applet client.  Threads are relatively expensive. Also, you should
> take into consideration that certain routers won't let you keep a
> connection open indefinitely.
> To solve your load-balancing issue, I guess you could assign a
> globally unique ID to each active applet, and have the load balancer
> redirect/proxy applet connections to the right server based on the ID,
> or have the applet establish an initial connection with all the load
> balanced servers, or get the servers to talk to each other. It depends
> on what you can do with the load balancer you're using.

What you describe is what TC4.0.2 + mod_jk + apache does. You assign a unique
jvmRoute to each of you tomcats and mod_jk does the rest. 

Also note that any attributes assigned to a session can only be
available in one VM.

> --Jose
> ----- Original Message -----
> From: Vjeran Marcinko <>
> Sent: Sunday, February 10, 2002 09:01 AM
> To: Tomcat Users List
> Subject: Re: Load balancing app context ?
> ----- Original Message -----
> From: "Jose Solorzano" <>
> To: <>; <>
> Sent: Sunday, February 10, 2002 2:32 PM
> Subject: RE: Load balancing app context ?
> >
> > What kind of state do you store in those variables?
> >
> > With multiple VMs, you can store user/session state in cookies, in a
> > shared database or you can use an application server.
> >
> > --Jose
> Well, I know it sounds weird, but I'm storing servlet's output stream
> in those variables. And than I block this servlet, thus it won't be
> able to close its output stream, which is the thing that happens when
> servlet thread goes out of its service() method.
> This way I have persistent output stream to client. And then all
> future HTTP requests can fetch this stored output stream and send some
> data back to client. But since I have multiple JVMs, this stored
> variable isn't unique anymore, because there are as many variables as
> there are JVMs, and each of them has its own servlet instance, right ?
> Thing works perfectly with one servlet engine instance, but I guess it
> won't do in load-balancing case...  I didn't consider session till
> now, since client is applet and not browser, and I'm not sure how good
> is applet's URLConnection doing with cookies ?
> -Vjeran

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message