----------
From: Bernie Bernstein bernard@corp.talkcity.com
To: "Java Apache Servlet List" java-apache@list.working-dogs.com
Subject: Load-balancing features moving along
Date: Wed, Jan 13, 1999, 11:08 PM
I just wanted to add a few comments to Jean-Luc's message (and change the
subject of the post to attract some more interest).
>> 3) how do you manage fault tollerance and session handling?
>
>fault tolerance is not really here fault tolerance. But what we do is
>redirect the end user on a different JServ if the targeted one is
>unavailable but the session is lost.
There are varying definitions of fault-tolerance. This system doesn't move
sessions around between machines, so sessions can be lost if the machine
running that session goes down, but the subsequent request will be directed
to a working server for a new session. This system will tolerate servers
failing to work by skipping the broken ones and only passing requests
through to the working ones. I think there is room in this system for
someone to add true fault-tolerance, but I wouldn't want to see that impede
performance.
>Session handling is done using cookies. The marvelous idea (from Bernie,
>again) is that JServ doesn't know about load-balancing. This means that
>you can just distribute as many JServ as needed without modifying JServ
>config files, only Apache's. Really easy for administrators.
Actually, it's cookies or parameter; the same as JServ always has worked,
but it has the added feature that it can route subsequent requests to the
engine that is holding that session.
In the configuration. If you don't use the load-balancing features, there
should be no performance difference by having these features in the system.
This was an important criteria for us when designing its integration.
If you do choose to use these features, the overhead involves storing the
equivalent of lists of server mounts which represent a single server mount
as a balanced set.
Credit for the configuration definitions goes mostly to Jean-Luc. He showed
me what a configuration may look like and we iterated a few times to come
up with what we believe to be a very flexible system.
ApJServMount is the same as before, but now we have a new protocol called
"balance" (you may remember the prototype I made a few months ago that did
something like this). The existing protocol, "ajpv11" will continue to work
here as expected. The "balance" prototype will expect some identifier of a
set of servers as defined by ApJServBalance as the set of servers that will
contain that mounted zone.
ApJServBalance <balance identifier> <host identifier> [weight]
ApJServBalance adds a host to a balance set. The weight is optional. In the
current implementation, this host is simply replicated in the
circular-linked-list the number of times of the weight, so don't put huge
numbers there until that is better implemented.
ApJHost <host identifier> <host URI>
ApJHost identifies a host URI (identical to the existing ApJServMount
definition).
ApJRoute <cookie tag> <host identifier>
This is some string that is appended to the session cookie to identify the
given host to mod_jserv, so that it knows where to send the request.
I'm including Jean-Luc's example config file here:
Here is my httpd.conf specific :
ApJServMount /servlets balance://hostset1/root //old style compatible
(existing config still working)
ApJServMount /zone2 balance://hostset1/zone2
ApJServMount /zone3 balance://hostset2/zone3
ApJServBalance hostset1 JSBox1
ApJServBalance hostset1 JSBox2
ApJServBalance hostset2 JSBox3 4 //the optionnal field is the weigth
(default 1). this is a 4*CPU
ApJServBalance hostset2 JSBox4
ApJHost JSBox1 ajpv11://r26m24:10001
ApJHost JSBox2 ajpv11://r26m24.cybercable.fr:10002
ApJHost JSBox3 ajpv11://localhost:10003
ApJHost JSBox4 localhost
//That is enough for load-balacing.
//This is for sessions handling : (cookie ends by B2 for sessions in
JSBox2 JServ).
// Apache send this to JServ in the environment variables
ApJRoute JS1 JSBox1
ApJRoute B2 JSBox2
ApJRoute JSB3 JSBox3
ApJRoute B4 JSBox4
//end config file
Special greetings to Bernie Bernstein who did the job, I was just here
for ideas, proposals, review.
Jean-Luc Rochat
Thanks much to Jean-Luc for taking this on and championing this component.
Bernie Bernstein
LiveWorld Productions
voice: 408-871-3227 Join the Conversation.
email: bernard@liveworld.com http://www.talkcity.com/ |