You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohan Wickramasinghe <mo...@roomsnet.com> on 2006/03/06 08:23:02 UTC

mod_jk Loadbalancer Not working as Expected

Hi All

We have set up Loadbalacning of Jboss 4.0.3 using  Apache2 (2.0.53),
mod_jk 1.2.15.

We have currently got 10 Tomcat Servers ( 5 on one server, 3 on another
server and 2 on another server)

We expect all workers to get the same amount of load (checked using the
'Busy' attribute show in the jkstatus page).
But we do not see the Busy sessions distributed evenly during heavy
traffic periods to our sites.
Instead we see that one Workers Busy goes up to around 20 and is stuck
(the
worker gets stuck) and the other workers are still having 0 Busy
connections.
So we, using the jkmanager stop traffic to the worker that is stuck and
re-start that tomcat node.
Please help. The workers.property file is as follows....
Thanks in Advance.
All our servers are RHEL4 with SMP kernel with 4GB RAM, runnning
Blackdown JVM 1.4.2

---
Worker.property



#
# workers.properties
#

# In Unix, we use forward slashes:
ps=/

# list the workers by name
#worker.list=jboss1, jboss2, loadbalancer
worker.list=loadbalancer, jkstatus

# ------------------------
# abc123 1 JBoss server
# ------------------------
worker.abc123_1.port=8009
worker.abc123_1.host=192.168.1.1
worker.abc123_1.type=ajp13
# Specify the size of the open connection cache.
worker.abc123_1.cachesize=1
worker.abc123_1.domain=www.groupabc123.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.abc123_1.lbfactor=100
#worker.abc123_1.redirect=abc123_2
worker.abc123_1.stopped=0
worker.abc123_1.retries=0
worker.abc123_1.socket_timeout=180

# ------------------------
# abc123 2 JBoss server
# ------------------------
worker.abc123_2.port=18009
worker.abc123_2.host=192.168.1.1
worker.abc123_2.type=ajp13
# Specify the size of the open connection cache.
worker.abc123_2.cachesize=1
worker.abc123_2.domain=www.groupabc123.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.abc123_2.lbfactor=100
#worker.abc123_2.redirect=abc123_3
worker.abc123_2.stopped=0
worker.abc123_2.retries=0
worker.abc123_2.socket_timeout=180

# ------------------------
# abc123 3 JBoss server
# ------------------------
worker.abc123_3.port=38009
worker.abc123_3.host=192.168.1.1
worker.abc123_3.type=ajp13
# Specify the size of the open connection cache.
worker.abc123_3.cachesize=1
worker.abc123_3.domain=www.groupabc123.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.abc123_3.lbfactor=100
#worker.abc123_3.redirect=abc123_1
worker.abc123_3.stopped=0
worker.abc123_3.retries=0
worker.abc123_3.socket_timeout=180

# ------------------------
# def456 1 JBoss server
# ------------------------
worker.def456_1.port=8009
worker.def456_1.host=192.168.1.2
worker.def456_1.type=ajp13
# Specify the size of the open connection cache.
worker.def456_1.cachesize=1
worker.def456_1.domain=www.groupdef456.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.def456_1.lbfactor=100
#worker.def456_1.redirect=def456_2
worker.def456_1.stopped=0
worker.def456_1.retries=0
worker.def456_1.socket_timeout=180

# ------------------------
# def456 2 JBoss server
# ------------------------
worker.def456_2.port=18009
worker.def456_2.host=192.168.1.2
worker.def456_2.type=ajp13
# Specify the size of the open connection cache.
worker.def456_2.cachesize=1
worker.def456_2.domain=www.groupdef456.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.def456_2.lbfactor=100
#worker.def456_2.redirect=def456_3
worker.def456_2.stopped=0
worker.def456_2.retries=0
worker.def456_2.socket_timeout=180


# ------------------------
# def456 3 server
# ------------------------
worker.def456_3.port=38009
worker.def456_3.host=192.168.1.2
worker.def456_3.type=ajp13
# Specify the size of the open connection cache.
worker.def456_3.cachesize=1
worker.def456_3.domain=www.groupdef456.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.def456_3.lbfactor=100
#worker.def456_3.redirect=def456_4
worker.def456_3.stopped=0
worker.def456_3.retries=0
worker.def456_3.socket_timeout=180

# ------------------------
# def456 4 JBoss server
# ------------------------
worker.def456_4.port=48009
worker.def456_4.host=192.168.1.2
worker.def456_4.type=ajp13
# Specify the size of the open connection cache.
worker.def456_4.cachesize=1
worker.def456_4.domain=www.groupdef456.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.def456_4.lbfactor=100
#worker.def456_4.redirect=def456_5
worker.def456_4.stopped=0
worker.def456_4.retries=0
worker.def456_4.socket_timeout=180

# ------------------------
# def456 5 JBoss server
# ------------------------
worker.def456_5.port=58009
worker.def456_5.host=192.168.1.2
worker.def456_5.type=ajp13
# Specify the size of the open connection cache.
worker.def456_5.cachesize=1
worker.def456_5.domain=www.groupghi789.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.def456_5.lbfactor=100
#worker.def456_5.redirect=def456_1
worker.def456_5.stopped=0
worker.def456_5.retries=0
worker.def456_5.socket_timeout=180

# ------------------------
# ghi789 1 server
# ------------------------
worker.ghi789_1.port=8009
worker.ghi789_1.host=192.168.1.3
worker.ghi789_1.type=ajp13
# Specify the size of the open connection cache.
worker.ghi789_1.cachesize=1
worker.ghi789_1.domain=www.groupghi789.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.ghi789_1.lbfactor=100
#worker.ghi789_1.redirect=ghi789_2
worker.ghi789_1.stopped=0
worker.ghi789_1.retries=0
worker.ghi789_1.socket_timeout=180


# ------------------------
# ghi789 2 server
# ------------------------
worker.ghi789_2.port=18009
worker.ghi789_2.host=192.168.1.3
worker.ghi789_2.type=ajp13
# Specify the size of the open connection cache.
worker.ghi789_2.cachesize=1
worker.ghi789_2.domain=www.groupghi789.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.ghi789_2.lbfactor=100
#worker.ghi789_2.redirect=ghi789_3
worker.ghi789_2.stopped=0
worker.ghi789_2.retries=0
worker.ghi789_2.socket_timeout=180

# ------------------------
# ghi789 3 server
# ------------------------
worker.ghi789_3.port=38009
worker.ghi789_3.host=192.168.1.3
worker.ghi789_3.type=ajp13
# Specify the size of the open connection cache.
worker.ghi789_3.cachesize=1
worker.ghi789_3.domain=www.groupghi789.com
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.ghi789_3.lbfactor=100
#worker.ghi789_3.redirect=ghi789_1
worker.ghi789_3.stopped=0
worker.ghi789_3.retries=0
worker.ghi789_3.socket_timeout=180

# ------------------------
# Load Balancer worker
# ------------------------

#
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
#  ----> If a worker dies, the load balancer will check its state
#        once in a while. Until then all work is redirected to peer
#        worker.
worker.loadbalancer.type=lb

worker.loadbalancer.balance_workers=abc123_1, def456_1, ghi789_1,
def456_2,
ghi789_2, abc123_2, abc123_3, def456_3, ghi789_3,def456_4, def456_5


worker.loadbalancer.local_worker_only=1
worker.sticky_session=1
worker.jkstatus.type=status


#
# END workers.properties
#

your advice is urgently required.
thanks

Re: mod_jk Loadbalancer Not working as Expected

Posted by Mladen Turk <ml...@jboss.com>.
Mohan Wickramasinghe wrote:
> Hi All
> 
> We have set up Loadbalacning of Jboss 4.0.3 using  Apache2 (2.0.53),
> mod_jk 1.2.15.
> 
> worker.abc123_1.domain=www.groupabc123.com

See the red note about worker names at:
http://tomcat.apache.org/connectors-doc/config/workers.html

The same applies for the domain names, because in that case
the domain will be used as jvmRoute, and you will need
session replication between the members of the same domain.

> worker.loadbalancer.type=lb
>

add:
worker.loadbalancer.lock=P


> 
> worker.loadbalancer.local_worker_only=1

This directive is obsolete (dummy) with 1.2.12+

> worker.sticky_session=1
> worker.jkstatus.type=status
> 

Regards,
Mladen.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org