-
1. Re: mod_cluster load balancing
jfclere Apr 19, 2010 3:04 AM (in response to rmdavidson)Which listener are you using?
-
2. Re: mod_cluster load balancing
rmdavidson Apr 19, 2010 3:47 AM (in response to jfclere)Hi Jean.
<Listener className="org.jboss.modcluster.ModClusterListener" .../>
Thanks,
Rob.
-
3. Re: mod_cluster load balancing
pferraro Apr 19, 2010 10:16 AM (in response to rmdavidson)Try this:
<Listener className="org.jboss.modcluster.ModClusterListener"
loadMetricClass="org.jboss.load.metric.impl.AverageSystemLoadMetric"
... />
The load properties are documented here:
http://www.jboss.org/mod_cluster/java/properties.html#load
This will
N.B. AverageSystemLoadMetric uses OperatingSystemMXBean.getSystemLoadAverage() which requires at least Java 1.6.
-
4. Re: mod_cluster load balancing
mrojas435024 Aug 24, 2010 6:33 PM (in response to pferraro)Hi Paul,
I am using: <Listener className="org.jboss.modcluster.catalina.ModClusterListener" advertise="true"/>
how I could use another load metric?
-
5. Re: mod_cluster load balancing
pferraro Aug 25, 2010 10:19 AM (in response to mrojas435024)e.g.
<Listener className="org.jboss.modcluster.catalina.ModClusterListener"
loadMetricClass="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric"
advertise="true"/>
You can also override the default settings for history, weight and capacity.
The list of properties governing load factor behavior and their default values are described here:
http://docs.jboss.org/mod_cluster/1.1.0/html/java.properties.html#load
The complete set of available load metrics are listed here:
-
6. Re: mod_cluster load balancing
mrojas435024 Aug 25, 2010 2:43 PM (in response to pferraro)Thanks Paul for your answer,
but I tried this:
<Listener className="org.jboss.modcluster.catalina.ModClusterListener"
loadMetricClass="org.jboss.modcluster.load.metric.impl.AverageSystemLoadMetric"
advertise="true"/>
and it throws me the next error :
java.lang.NullPointerException
at org.jboss.modcluster.catalina.ModClusterListener.createLoadBalanceFactorProvider(ModClusterListener.java:118)
at org.jboss.modcluster.ModClusterService.init(ModClusterService.java:164)
at org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter.init(CatalinaEventHandlerAdapter.java:326)
at org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter.lifecycleEvent(CatalinaEventHandlerAdapter.java:246)
at org.jboss.modcluster.catalina.ModClusterListener.lifecycleEvent(ModClusterListener.java:145)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:770)
at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)what am I doing wrong?
-
7. Re: mod_cluster load balancing
pferraro Aug 25, 2010 5:13 PM (in response to mrojas435024)Actually, this is a bug. Looks like this has been around for a while. Thanks for bringing it to my attention.
https://jira.jboss.org/browse/MODCLUSTER-183
I've committed a fix to trunk. Unfortunately, we've already tagged 1.1.0.Final for release.
Until 1.1.1 is released, you can build the server-side module from source. Instructions here:
http://docs.jboss.org/mod_cluster/1.1.0/html/java.building.html