1) Real round robin
If you really want to distribute requests fully via round robin, you
need to set
worker.loadbalancer.sticky_session=False
2) Session stickyness
But usually, this is *not* what you want. Usually, you want requests,
that belong to a user session to go to the same Tomcat instance, where
the session has been created, and only requests which do not refer to a
session should be fully load balanced. So depending on the number of
sessions relative to the number of new session requests, only a small
percentage of your requests will be available for real balancing.
If you test balancing only with a couple of clients, it's quite
possible, that you are only using *very* few sessions, and most of the
balancing decisions are dictated by the first instance the session hit.
If you've got 3 workers in the balancer, and only two of them actually
get requests (which I learn from the N/A for worker B), it's likely,
that you are testing with only two sessions, which most likely is
totally unrealistic.
In case of session stickyness, there is no way of telling the
loadbalancer to use round robin for the new session requests (i.e.
requests which do not refer to a session). We have several ways of
deciding which node should be chosen (see "method" attribute of the load
balancer), but round robin is none of them.
Regards,
Rainer
Dean Lonsdale wrote:
Hi all
We are currently trying to setup load balancing in our environment and as
after testing the Load Balancing it would appear to be working. I have run
up two applications sessions, one of which went to the 'A' tomcat worker
and the other to the 'C' tomcat worker. The status page suggests that the
workers are load balanced, although as yet the 'B' worker has only ever
appeared with a status of 'N/A' (Unknown). Other workers have appeared
with a status of 'OK'.
I suspect that this load balancer is not using a 'Round Robin' algorithm.
I also cannot see any way of setting this as a Load Balancer method. Below
is our workers.properties file, could anyone please advise why a round
robin approach may not be working pls ?
thanks in advance
# ==============================================================
# JK configuration directives
# ==============================================================
ps=/
# ==============================================================
# list the workers required as entry points from apache by name
# ==============================================================
worker.list= ajp13, loadbalancer , status
# ==============================================================
# Single worker to handle all non load balanced requests
# (Esri IMS)
# ==============================================================
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
# ==============================================================
# Balanced set of workers to handle all load balanced requests
# (IMF Easimap)
# ==============================================================
# ---------------------------
# 1st Balanced worker Tomcat1
# ---------------------------
worker.tomcat1.port=8109
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.socket_keepalive=1
worker.tomcat1.socket_timeout=600
worker.tomcat1.lbfactor=100
worker.tomcat1.route=tomcat5_A
worker.tomcat1.connection_pool_timeout=300
# ---------------------------
# 2nd Balanced worker Tomcat2
# ---------------------------
worker.tomcat2.port=8209
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.socket_keepalive=1
worker.tomcat2.socket_timeout=600
worker.tomcat2.lbfactor=100
worker.tomcat2.route=tomcat5_B
worker.tomcat2.connection_pool_timeout=300
# ---------------------------
# 3rd Balanced worker Tomcat3
# ---------------------------
worker.tomcat3.port=8309
worker.tomcat3.host=localhost
worker.tomcat3.type=ajp13
worker.tomcat3.socket_keepalive=1
worker.tomcat3.socket_timeout=600
worker.tomcat3.lbfactor=100
worker.tomcat3.route=tomcat5_C
worker.tomcat3.connection_pool_timeout=300
#--------------------------
# Tomcat balancer
#--------------------------
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1, tomcat2, tomcat3
# ==============================================================
# Tomcat status worker - gives status information on connected
# instances
# ==============================================================
worker.status.type=status
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]