You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andrew Cowie <af...@upoc-inc.com> on 2000/08/17 02:39:06 UTC

Load balacing

I normally would not have posted post here but we at a critical point, and
urgently need your help, and so I have a question specifically for Gal
Shachor and Jean-Luc Rochat, but would appreciate input from the developers
as a whole. My question:

				Is load balancing working?

I am referring to configuring Apache so that mod_jserv sends JSERV_ROUTE
information over ajp12 to multiple Tomcat servlet machines, leading to the
Tomcat which receives a new connection to append JSERV_ROUTE to the
JSESSIONID cookie it sends back, so that future web requests are routed to
the correct servlet machine (with the user's session).

We have sniffed the traffic to 8007, and identified the text "JS1" (the
ApJServRoute for that particular server) - so mod_jserv seems to be working.
However, examining the cookies that the user's browser receives, the .JS1 is
never appended to the cookie, and so the next request is not routed by
mod_jserv to the correct Servlet machine.

The section of our httpd.conf which governs mod_jserv (modeled on the
Load-Balancing-HOWTO document) is included below my signature. Everything
else works - the pages compile and are served up correctly - it's just that
the JSESSIONID cookie is not being returned with the ".JS1" (or ".JS2")
appended, leading the next request to go to a random servlet; of course if
it doesn't go to the right one, crunch.

We have spent the better part of 5 days reading the source code for both
mod_jserv and the Ajp, Request, and other relevant classes in Tomcat. It
looks as if the code is there, but we cannot see any evidence of a
configuration parameter which we have to set on the Tomcat side to turn it
on. Every email I have seen on the subject in either Apache-Java or Jakarta
refers to it "just working" following checkins in February and April.

Configuration:

web servers (4)
	Sun Netra T1 running Solaris 2.7
	Apache 1.3.11
	mod_jserv from Tomcat 3.1 (which is the same as JServ 1.1.2 anyway)

servlet servers (2)
	Sun 220R  running Solaris 2.7
	Tomcat 3.1


Any response on this subject would be greatly appreciated. If we cannot
figure this out soon we will likely have to hardwire web servers to servlet
machines, and that would seriously erode our scalability and fault
tolerance.

Merci a tous,

		Andrew

--
Andrew Frederick Cowie
Director of Operations
Upoc, Inc

cell: 917-217-4578  office: 212-405-1044
afcowie@upoc-inc.com




------ extracted from httpd.conf ------ (it is the same on each web server).


<IfModule mod_jserv.c>

ApJServManual on

# everything goes to the balanced set
ApJServMount default balance://set1/root

# establishes hosts in the set to balance over
ApJServBalance set1 SERV1
ApJServBalance set1 SERV2

# maps hosts to actual server DNS names
ApJServHost SERV1 ajpv12://servlet1.upoc.com:8007
ApJServHost SERV2 ajpv12://servlet2.upoc.com:8007

# establishes cookie-based routing to restrict each session to a single host
ApJServRoute JS1 SERV1
ApJServRoute JS2 SERV2

# "shared memory" file for apache processes running on this server
ApJServShmFile log/jserv_shm

ApJServSecretKey DISABLED

# note that the following directives are not from the above-mentioned
example
ApJServLogLevel notice
AddType test/jsp .jsp
AddHandler jserv-servlet .jsp

</IfModule>