<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Valtech E-Mail Footer</TITLE>
</HEAD>
<BODY >
<DIV><html><body style="word-wrap: break-word; -webkit-nbsp-mode: 
space; -webkit-line-break: after-white-space; ">Folks,<div>I am currently 
trying to scale our implementation by farming out request into mutliple 
threads. I am on a 4 CPU Mac.</div><div>A few things I am wondering 
about:</div><div>1. Although I see an increase in CPU load when going from 
single to multi-threaded processing the throughput increased marginally. I 
am pretty sure that my measurements are correct.&nbsp;I have checked the 
GC and this is not the source of congestion. My question here is whether 
Drools is using lot's of synchronization that may explain 
this.&nbsp;</div><div>2. When I share the RuleBase accross threads (which 
I think is valid?) I get&nbsp;interesting&nbsp;errors 
during&nbsp;execution. eg:</div><div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span style="text-decoration: underline ; color: 
#000080">org.drools.RuntimeDroolsException</span>: Exception executing 
predicate org.drools.base.mvel.MVELPredicateExpression@bb981e</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.rule.PredicateConstraint.isAllowedCachedRight(<span 
style="text-decoration: underline ; color: 
#000080">PredicateConstraint.java:246</span>)</div><div style="margin-top: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.drools.common.TripleBetaConstraints.isAllowedCachedRight(<span 
style="text-decoration: underline ; color: 
#000080">TripleBetaConstraints.java:200</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.reteoo.JoinNode.assertObject(<span style="text-decoration: 
underline ; color: #000080">JoinNode.java:150</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(<span 
style="text-decoration: underline ; color: 
#000080">CompositeObjectSinkAdapter.java:318</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.reteoo.ObjectTypeNode.assertObject(<span 
style="text-decoration: underline ; color: 
#000080">ObjectTypeNode.java:153</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.drools.reteoo.Rete.assertObject(<span style="text-decoration: 
underline ; color: #000080">Rete.java:175</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.reteoo.ReteooRuleBase.assertObject(<span 
style="text-decoration: underline ; color: 
#000080">ReteooRuleBase.java:192</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.drools.reteoo.ReteooWorkingMemory.doInsert(<span 
style="text-decoration: underline ; color: 
#000080">ReteooWorkingMemory.java:71</span>)</div><div style="margin-top: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.drools.common.AbstractWorkingMemory.insert(<span 
style="text-decoration: underline ; color: 
#000080">AbstractWorkingMemory.java:909</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.common.AbstractWorkingMemory.insert(<span 
style="text-decoration: underline ; color: 
#000080">AbstractWorkingMemory.java:881</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.common.AbstractWorkingMemory.insert(<span 
style="text-decoration: underline ; color: 
#000080">AbstractWorkingMemory.java:682</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atxxxx.DroolsPD.validate(<span style="text-decoration: underline ; color: 
#000080">DroolsPD.java:66</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
xxxx.DroolsMTRunner.run(<span style="text-decoration: underline ; color: 
#000080">DroolsMTRunner.java:30</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
java.lang.Thread.run(<span style="text-decoration: underline ; color: 
#000080">Thread.java:552</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); ">Caused by: 
<span style="text-decoration: underline ; color: 
#000080">org.mvel.CompileException</span>: cannot invoke getter: 
getSAClass [declr.class: xxx.AbstractSA; act.class: null]</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.mvel.optimizers.impl.refl.GetterAccessor.getValue(<span 
style="text-decoration: underline ; color: 
#000080">GetterAccessor.java:52</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.optimizers.impl.refl.VariableAccessor.getValue(<span 
style="text-decoration: underline ; color: 
#000080">VariableAccessor.java:39</span>)</div><div style="margin-top: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(<span 
style="text-decoration: underline ; color: 
#000080">VariableDeepPropertyNode.java:22</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.mvel.ast.PropertyASTNode.getReducedValueAccelerated(<span 
style="text-decoration: underline ; color: 
#000080">PropertyASTNode.java:21</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(<span 
style="text-decoration: underline ; color: 
#000080">BinaryOperation.java:21</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.MVELRuntime.execute(<span style="text-decoration: underline ; 
color: #000080">MVELRuntime.java:88</span>)</div><div style="margin-top: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.CompiledExpression.getValue(<span style="text-decoration: 
underline ; color: #000080">CompiledExpression.java:111</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.mvel.MVEL.executeExpression(<span style="text-decoration: underline ; 
color: #000080">MVEL.java:235</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.drools.base.mvel.MVELPredicateExpression.evaluate(<span 
style="text-decoration: underline ; color: 
#000080">MVELPredicateExpression.java:36</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atorg.drools.rule.PredicateConstraint.isAllowedCachedRight(<span 
style="text-decoration: underline ; color: 
#000080">PredicateConstraint.java:240</span>)</div><div style="margin-top: 
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>... 13 
more</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 
0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; 
color: rgb(0, 0, 128); "><span style="color: #ff0000">Caused by: 
</span><span style="text-decoration: 
underline">java.lang.NullPointerException</span></div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atsun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atsun.reflect.DelegatingMethodAccessorImpl.invoke(<span 
style="text-decoration: underline ; color: 
#000080">DelegatingMethodAccessorImpl.java:25</span>)</div><div 
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; 
margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: 
rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre"></span>atjava.lang.reflect.Method.invoke(<span style="text-decoration: underline ; 
color: #000080">Method.java:324</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>at 
org.mvel.optimizers.impl.refl.GetterAccessor.getValue(<span 
style="text-decoration: underline ; color: 
#000080">GetterAccessor.java:42</span>)</div><div style="margin-top: 0px; 
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal 
normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span 
class="Apple-tab-span" style="white-space:pre">        </span>... 22 
more</div></div><div><br 
class="webkit-block-placeholder"></div><div>Details:</div><div>&nbsp;* I 
use StatelessSessions which are private to the threads</div><div>&nbsp;* 
No data is shared between threads (with the exception of the RuleBase, as 
outline above)</div><div>&nbsp;* I am on JDK 1.5</div><div><br 
class="webkit-block-placeholder"></div><div>I would be grateful for any 
pointers for 'correct' use of Drools in an MT 
environment.</div><div>Cheers,</div><div>&nbsp;&nbsp;Ingomar</div></body></html><BR></DIV>
<eXclaimer:HTML_ONLY>
<DIV ID="sender" STYLE="FONT-SIZE: 8pt; COLOR: #808080; LINE-HEIGHT: 100%; 
FONT-FAMILY: Arial, Helvetica, sans-serif"><SPAN STYLE="FONT-WEIGHT: bold; 
FONT-SIZE: 9pt; COLOR: #000000"><BR>Ingomar Otter</SPAN><BR><SPAN 
STYLE="FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #ff870a">Chief Technology 
Officer</SPAN><BR>ingomar.otter@valtech.de<BR>Mobile: +49 172 
2367867<BR><BR><SPAN STYLE="FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: 
#000000">Valtech GmbH</SPAN><BR>Bahnstra&#223;e 16<BR>40212 
D&#252;sseldorf<BR>Germany<BR><BR>Phone: +49 (0)211 179237-0<BR>Fax: +49 
211 179237-19<BR><BR><A STYLE="COLOR: #808080" 
HREF="http://www.valtech.de/">www.valtech.de</A><BR><BR>Gesch&#228;ftsf&#252;hrer: 
Ingo Kriescher<BR>Amtsgericht D&#252;sseldorf HRB48672</DIV>
</eXclaimer:HTML_ONLY>&nbsp; <BR>
<DIV>
</DIV></BODY></HTML>