"Diethelm Guallar, Gonzalo" wrote:
>
> One of the reasons we have chosen a Java app server to base our
> development on is the advertised ability to add more instances of the
> app server when the load so requires, and that this balancing process
> is transparent to the programmer. However, I have not really tried
> the experiment to see how this is done. Therefore, I have a few
> questions, and would appreciate answers or pointers to information:
>
> 1. Is the load balancing always done from the web server? I know the
> web server could redirect all incoming requests to any of the app
> servers, probably based on some idea of the load present on each
> one. Is this the "standard" way of doing things? Does Apache
> support doing this? How do the commercial app servers (say,
> WebLogic or WebSphere), which come with their own web server,
> handle this? How does IIS handle it?
mod_jserv and mod_jk support load balancing - single web server can
connect to multiple servlet engines. New connections are sent to
servlet engines in a round-robin fashion, plus you can set 'weights'
so that certain engines (presumably running on stronger hardware)
get more requests. Then, sessions are associated with specific
servlet engines and consequtive requests within the session
are sent to the same container. Load balancer uses the same
session information (urls/cookies) as the servlet container.
> 2. Would it be necessary for the web server to keep track of any
> concept of "session", so that successive requests from a given
> client are always handled to the same app server? If yes, who is
> responsible for keeping the mapping between session and app server,
> and how would the session be identified in an incoming request?
> Would cookies be required?
see above.
> 3. Does a Turbine-based servlet need to have any special code in order
> to handle this load balancing mechanism, or is this totally
> transparent for Turbine? If cookies are required, does Turbine know
> when and how to set the proper cookie?
The load balancing implemented in apache products never transfers an
user's session between the containers. If the container goes down,
the session is lost.
On the other hand, J2EE specification requires that all objects that
are stored into the the HttpSession should be Serializable. This means
that the application server can serialize the session and send it
to some other program, like session server (that is used to recover
the session after the associated container goes down) or all other
servlets containers in the cluster (IP multicast could prove usefull
here!). I know that BEA WebLogic Server has an advanced clustering
solution (it's not available for free evaluation though).
Other middleware products probably have these too.
I'm interested in sharing knowledge about clustering/load balancing,
because it's the subject of my Masters thesis. I'm supposed to write
it till July <shrug>...
Rafal
--
Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]