I am using mod_jk 1.2.5 w/Apache 1.3.28, talking to JBoss w/integrated Tomcat 4.1.24. I am attempting to use the lb worker to load balance across two instances of Tomcat. I will eventually do this against as many as 5 Tomcat instances.

I am having limited success getting an equal distribution of sessions. I know it will never be exactly equal, but one box is consistently receiving an inordinate amount of the the load.

My workers.properties looks like:

worker.list.loadbalancer, load1, load2

worker.load1.port=8009
worker.load1.host=load1
worker.load1.type=ajp13
worker.load1.lbfactor=10
worker.load1.cachesize=10
worker.load1.cache_timeout=600
worker.load1.socket_keepalive=1
worker.load1.socket_timeout=300

(load2 is the same, except for the .host)

I load-balance the http requests via a hardware round-robin. Both hosts have identical workers.properties.

First, I'd like to clear up some questions about mod_jk itself (these are source code related, hence not posting to -user).

The array which holds the workers (and their lb_value, factor, etc) seems to be a per-apache-process structure created in validate() of jk_lb_worker.c. So each apache process independently increments the lb_value in get_most_suitable_worker?

Also, the jk_get_lb_worker_list function seems cause the first worker listed in balanced_workers property to be the 0th element of the p->lb_workers array.

These two things (if correct) would cause each Apache process to choose the first worker in balanced_workers to handle the first request received, resulting in the first n sessions to be sent to the same box (where n is the number of apache processes). I'm not sure if Apache round-robins it's children...

Obviously, newly created apache children will have no history of requests to base their get_most_suitable_worker on, and, if my above statement about the first balanced worker is correct, then they will send the first request to the first worker. If my number of initial apache servers is low, and my load is spikey, this could cause a burst of children to be born and send their first request to the same box. They would then die when the load subsides.

Now, after the session ID is established, mod_jk is doing a fantastic job of sending the request to the proper servlet container. My problem is getting the 'new' users to distribute evenly between my two boxes. This imbalance only seems to manifest itself under heavy load, hence my ideas about apache children.

I appreciate any clarification on this issue ;)

Cory 'G' Watson
http://www.loggerithim.org

"The universal aptitude for ineptitude makes any human accomplishment an incredible miracle." - Dr. John Paul Stapp


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to