I'm using AS 7.1.1.Final + HTTPD mod_cluster 1.2.0.Final - all works fine.
My question is regarding capacity values in JBoss modcluster configuration.
<mod-cluster-config advertise-socket="modcluster" advertise-security-key="secret">
<dynamic-load-provider history="10" decay="2">
<load-metric type="heap" weight="3" capacity="1024"/>
<load-metric type="cpu" weight="2" capacity="2"/>
<load-metric type="mem" weight="2" capacity="16"/>
<load-metric type="sessions" weight="1" capacity="150"/>
According to http://docs.jboss.org/mod_cluster/1.2.0/html_single/#ModClusterSubSystem load() of dynamic load providers should return load value between 0-100% and the load-metric is ((load / capacity) * weight).
So, assumming all JBoss instances run on machines with same CPU and memory, what should be the capacity values for every load-metric ?
For example, if start JBoss JVM with 1024MB of heap should the capacity be 1024 or 1 ?
For sessions it is totally unclear what should be the metric. Is it max expected sessions count ?
Any idea for sessions capacity ?
Do some testing on standard workflow in your application and figure out how many sessions are working OK (you also need to count in the delay between requests people typicall do and depending on what is acceptable for you monitor for CPU usage below 100%, remaining memory, good reponse times, etc) and that will be the capacity per server.
Can you point me to a list of load-metric type values ?
I would like to try roundrobin for testing, is that still available.
I currently use <load-metric type="busyness"/>
I want to try load leveling the "dumb" way because only master and one (of two) slaves is active at one time, the other one hangs on a timeout
No, capacity for CPU does not affect the calculation in any way. It is your average load divided by number of cores available to JVM. For instance, if you have 4 cores, your maximum "average load" value might be 400. This figure divided by 4 is Load returned. So, if you set your quad core on fire, it will return Load ~ 99 or so...
Actually, that's not quite correct. Capacity does indeed affect the load calculation.
The server side load calculation logic for mod_cluster is described in detail here:
If you set the capacity of your cpu metric to 2, the load number reported to the load balancer for the current node will be half of what it normally would be. The result is that the node will under-report its load to the load balancer, causing it to receive more requests in response than it normally would. If your goal instead is to over-report the load of a node, you would want to give it a fractional value, e.g. capacity="0.5".
Meh, yes, mea culpa. Paul is right. For the sake of clearness:
Load is obtained in AverageSystemLoadMetric as:
double load = this.bean.getSystemLoadAverage(); return load / this.bean.getAvailableProcessors();
However, the capacity is applied as same as for other metrics in DynamicLoadBalanceFactorProvider in this way:
this.recordLoad(metricLoadHistory, metric.getLoad(engine) / metric.getCapacity());