Hi Ingomar, <br><br>Which drools version are you using? We made improvements on 4.0.4, that fixes concurrency issues on mvel core, so if you aren&#39;t using it please do an update and try test against your environment. <br>
<br>Please let me know if your problems go away when you upgrade.<br><br>Thanks&nbsp;  <br><br><div class="gmail_quote">On Jan 22, 2008 11:13 AM, Ingomar Otter &lt;<a href="mailto:ingomar.otter@valtech.de">ingomar.otter@valtech.de
</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<div><div style="">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&#39;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: 0px; min-height: 15px;"><br></div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="text-decoration: underline; color: rgb(0, 0, 128);">org.drools.RuntimeDroolsException
</span>: Exception executing 
predicate org.drools.base.mvel.MVELPredicateExpression@bb981e</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atorg.drools.rule.PredicateConstraint.isAllowedCachedRight(<span style="text-decoration: underline; color: rgb(0, 0, 128);">
PredicateConstraint.java:246</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
org.drools.common.TripleBetaConstraints.isAllowedCachedRight(<span style="text-decoration: underline; color: rgb(0, 0, 128);">TripleBetaConstraints.java:200</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.drools.reteoo.JoinNode.assertObject(<span style="text-decoration: underline; color: rgb(0, 0, 128);">JoinNode.java:150</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(<span style="text-decoration: underline; color: rgb(0, 0, 128);">CompositeObjectSinkAdapter.java:318</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">
<span style="white-space: pre;"></span>atorg.drools.reteoo.ObjectTypeNode.assertObject(<span style="text-decoration: underline; color: rgb(0, 0, 128);">ObjectTypeNode.java:153</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">
<span style="white-space: pre;">        </span>at 
org.drools.reteoo.Rete.assertObject(<span style="text-decoration: underline; color: rgb(0, 0, 128);">Rete.java:175</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atorg.drools.reteoo.ReteooRuleBase.assertObject
(<span style="text-decoration: underline; color: rgb(0, 0, 128);">ReteooRuleBase.java:192</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
org.drools.reteoo.ReteooWorkingMemory.doInsert(<span style="text-decoration: underline; color: rgb(0, 0, 128);">ReteooWorkingMemory.java:71</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
        </span>at 
org.drools.common.AbstractWorkingMemory.insert(<span style="text-decoration: underline; color: rgb(0, 0, 128);">AbstractWorkingMemory.java:909</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.drools.common.AbstractWorkingMemory.insert(<span style="text-decoration: underline; color: rgb(0, 0, 128);">AbstractWorkingMemory.java:881</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.drools.common.AbstractWorkingMemory.insert(<span style="text-decoration: underline; color: rgb(0, 0, 128);">AbstractWorkingMemory.java:682</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atxxxx.DroolsPD.validate(<span style="text-decoration: underline; color: rgb(0, 0, 128);">DroolsPD.java:66</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
xxxx.DroolsMTRunner.run(<span style="text-decoration: underline; color: rgb(0, 0, 128);">DroolsMTRunner.java:30</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
java.lang.Thread.run(<span style="text-decoration: underline; color: rgb(0, 0, 128);">Thread.java:552</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">Caused by: 
<span style="text-decoration: underline; color: rgb(0, 0, 128);">org.mvel.CompileException</span>: cannot invoke getter: 
getSAClass [declr.class: xxx.AbstractSA; act.class: null]</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atorg.mvel.optimizers.impl.refl.GetterAccessor.getValue(<span style="text-decoration: underline; color: rgb(0, 0, 128);">
GetterAccessor.java:52</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
org.mvel.optimizers.impl.refl.VariableAccessor.getValue(<span style="text-decoration: underline; color: rgb(0, 0, 128);">VariableAccessor.java:39</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
        </span>at 
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(<span style="text-decoration: underline; color: rgb(0, 0, 128);">VariableDeepPropertyNode.java:22</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">
<span style="white-space: pre;"></span>atorg.mvel.ast.PropertyASTNode.getReducedValueAccelerated(<span style="text-decoration: underline; color: rgb(0, 0, 128);">PropertyASTNode.java:21</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">
<span style="white-space: pre;">        </span>at 
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(<span style="text-decoration: underline; color: rgb(0, 0, 128);">BinaryOperation.java:21</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
        </span>at 
org.mvel.MVELRuntime.execute(<span style="text-decoration: underline; color: rgb(0, 0, 128);">MVELRuntime.java:88</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
org.mvel.CompiledExpression.getValue(<span style="text-decoration: underline; color: rgb(0, 0, 128);">CompiledExpression.java:111</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.mvel.MVEL.executeExpression(<span style="text-decoration: underline; color: rgb(0, 0, 128);">MVEL.java:235</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>
at 
org.drools.base.mvel.MVELPredicateExpression.evaluate(<span style="text-decoration: underline; color: rgb(0, 0, 128);">MVELPredicateExpression.java:36</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
</span>atorg.drools.rule.PredicateConstraint.isAllowedCachedRight(<span style="text-decoration: underline; color: rgb(0, 0, 128);">PredicateConstraint.java:240</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);">
<span style="white-space: pre;">        </span>... 13 
more</div><div style="margin: 0px; color: rgb(0, 0, 128);"><span style="color: rgb(255, 0, 0);">Caused by: 
</span><span style="text-decoration: underline;">java.lang.NullPointerException</span></div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atsun.reflect.GeneratedMethodAccessor6.invoke
(Unknown Source)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atsun.reflect.DelegatingMethodAccessorImpl.invoke(<span style="text-decoration: underline; color: rgb(0, 0, 128);">
DelegatingMethodAccessorImpl.java:25</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;"></span>atjava.lang.reflect.Method.invoke(<span style="text-decoration: underline; color: rgb(0, 0, 128);">
Method.java:324</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">        </span>at 
org.mvel.optimizers.impl.refl.GetterAccessor.getValue(<span style="text-decoration: underline; color: rgb(0, 0, 128);">GetterAccessor.java:42</span>)</div><div style="margin: 0px; color: rgb(255, 0, 0);"><span style="white-space: pre;">
        </span>... 22 
more</div></div><div><br></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></div><div>I would be grateful for any 
pointers for &#39;correct&#39; use of Drools in an MT 
environment.</div><div>Cheers,</div><div>&nbsp;&nbsp;Ingomar</div></div><br></div>

<div style="font-size: 8pt; color: rgb(128, 128, 128); line-height: 100%; font-family: Arial,Helvetica,sans-serif;"><span style="font-weight: bold; font-size: 9pt; color: rgb(0, 0, 0);"><br>Ingomar Otter</span><br><span style="font-weight: bold; font-size: 9pt; color: rgb(255, 135, 10);">
Chief Technology 
Officer</span><br><a href="mailto:ingomar.otter@valtech.de" target="_blank">ingomar.otter@valtech.de</a><br>Mobile: +49 172 
2367867<br><br><span style="font-weight: bold; font-size: 9pt; color: rgb(0, 0, 0);">Valtech GmbH</span><br>Bahnstraße 16<br>40212 
Düsseldorf<br>Germany<br><br>Phone: +49 (0)211 179237-0<br>Fax: +49 
211 179237-19<br><br><a style="color: rgb(128, 128, 128);" href="http://www.valtech.de/" target="_blank">www.valtech.de</a><br><br>Geschäftsführer: 
Ingo Kriescher<br>Amtsgericht Düsseldorf HRB48672</div>
&nbsp; <br>
<div>
</div></div>
<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Fernando Meyer <a href="http://fmeyer.org">http://fmeyer.org</a><br>JBoss Rules Core Developer<br><a href="mailto:fernando@fmeyer.org">
fernando@fmeyer.org</a>