tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Vinayak <>
Subject RE: Multiple Tomcat workers (using mod_jk)
Date Thu, 13 Sep 2001 15:12:00 GMT
Thanks Jan -- that helps! Especially the bit regarding being able to JkMount
onto the "loadbalancer" worker.

Sooooo...seems like it would be more efficient to create multiple WORKERS of
Tomcat on same/different machines and let the loadbalancer work handle the
load balancing, as opposed to running multiple INSTANCES of Tomcat on
same/different machines and then having to use mod_rewrite to load balance
across them all. The latter approach sounds like not only more work, but
also a greater resource hog.

What I'm trying to accomplish is to run multiple concurrent instances this
thread-unsafe servlet. Ideally I should fix the servlet itself, but don't
have the liberty to do so for several reasons. I'm hoping to be able to
deploy this rogue servlet across multiple Tomcat workers (behind an Apache
web server) and then let the loadbalancer worker handle the request
allocation for me.

Comments, anyone?


-----Original Message-----
From: Jan Labanowski []
Sent: Thursday, September 13, 2001 12:23 AM
Subject: Re: Multiple Tomcat workers (using mod_jk)

I am not the developer, so I do not know... But this is what I think:
The workers are different instances of Tomcat, and can reside even on
different machines, i.e., obviously they run under different VMs
At the same time, the load balancing worker should send the request
which belong to the same session to the same worker for processing...
>From what I know, if you configure this right, the Apache talks only to
a single, load-balancing worker, and has no control over which worker
does the actuall processing, unless you mount different contexts to
workers, but then you are in control...

But yes, there is a lack of good documentation on doing load balancing with
mod_jk, though there is plenty on mod_jserv.

Here are some excripts from someone who tried this:
From: "David Cassidy (Programmer)" <>
Subject: Re: Tomcat and Apache on diffenet machines
Date: Fri, 25 May 2001 15:10:36 +0100

Yup this is possible ....

and if you are using the loadbalancing module ( so you can have more
than 1
tomcat for your apache(s) to talk to) essential

in you should find something like ...


To define another service try ...


You can define as many of these as you want.

You can then define a loadbalancer ( if you want to)

worker.loadbalancer.balanced_workers=ajp12, external_1, external_2 etc

and you have got load balancing

If you just want to use a single tomcat host then

in your mod_jk.conf

JkMount /test/* loadbalancer


JkMount /test/* external_1


On Thu, 13 Sep 2001, Tony Vinayak wrote:

> Folks,
> I've got a couple of quick newbie questions:
> Environment: Apache 1.3.20 on Solaris 8; Tomcat 3.2 (using mod_jk); Apache
> and Tomcat running on the same box.
> If I configure and run multiple Tomcat workers on the same machine
> (listening on different ports of course), and let's say they are all using
> ajp13 connector, do all those workers run in the SAME of DIFFERENT VM ?
> The reason I ask is that I've got a thread-unsafe servle that I want to
> deploy implementing "SingleThreadModel" across multiple concurrent
> of Tomcat, allowing concurrent requests to be processes. As the request
> into Apache, using mod_rewrite I want to direct it to one of the several
> Tomcat workers.
> regards,
> Tony

Jan K. Labanowski            |    phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center    |    Internet:
1224 Kinnear Rd,             |
Columbus, OH 43212-1163      |

View raw message