Hi, you can create multiple stateless sessions with the same rules in different threads, and processes to take advantage of the multiple cores that you have..<div><br></div><div>Cheers</div><div class="gmail_extra"><br><br>

<div class="gmail_quote">On Mon, Dec 10, 2012 at 8:11 PM, ping <span dir="ltr">&lt;<a href="mailto:jinpingv@hotmail.com" target="_blank">jinpingv@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

hi,<br>
I&#39;m new to Drools and I&#39;m doing some performance benchmark to see if I can<br>
scale up a StatelessSession engine. I did the benchmark on a 8 core machine<br>
but the results shows the engine can only take advantage of 1.5 cores at any<br>
time.<br>
here is my tests:<br>
1. create a KnowledgeBase<br>
2. started multiple threads (I tried 4/8/16 threads) running same loop:<br>
create a stateless session from KnowledgeBase and create a new fact, then<br>
insert the fact into the session.<br>
<br>
After running the test for multiple times I found that it can only utilize<br>
at most 1.5 cores at the same time.<br>
I also found that most of time threads were blocked by static class locks<br>
like:<br>
public static synchronized ProcessRuntimeFactoryService<br>
getProcessRuntimeFactoryService()<br>
<br>
<br>
Anyone has experience scaling up a stateless drools engine?<br>
<br>
Thanks a lot.<br>
<br>
-Ping<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-static-class-synchronization-tp4021160.html" target="_blank">http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-static-class-synchronization-tp4021160.html</a><br>


Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>
</div>