[rules-users] Parallelization

Mark Proctor mproctor at codehaus.org
Tue May 11 09:44:08 EDT 2010


They are for simple CEP type applications, you won't see a benefit else 
where, possibly a slow down if you are doing more business type rules.

Mark
On 11/05/2010 09:40, djb wrote:
> Hi Drools squad,
>
> This is a follow-up to my previous speed-related post.  By boss is still
> pushing to get 35ms down a bit, and I'm looking at parallelization options.
> I've looked through the forums, but not successfully...
>
> The options I see, are:
>
> 1. KnowledgeBase partitioning (setting KnowledgeBaseConfiguration to use
> multi-threads)
>     - I tried this, and got the error pasted at the bottom.  My suspicion is
> that it starts a thread, and meanwhile the Java thread continues, and
> disposes of the session before evaluation is complete.
>
> 2. Creating multiple Java threads, each of which starts its own
> KnowledgeSession.
>     - I started this, but need to confirm that this is possible.  What's
> happening currently, is that the Java thread continues, and closes my
> database connection prematurely, and so, I am working on adding some sort of
> counting-semaphore, to wait for all the threads to complete before
> continuing the Java thread.
>
> Should I pursue either of these ideas?  I will probably work on the second
> today.  The other idea I had was to try Sequential Mode, but I don't think
> my data is applicable to a StatelessKnowledgeSession.
>
> Thanks,
> Daniel
>
>
> ***************************
> Partition task manager caught an unexpected exception: null
> Drools is capturing the exception to avoid thread death. Please report stack
> trace to development team.
> java.util.concurrent.RejectedExecutionException
> 	at
> java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
> 	at
> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
> 	at
> java.util.concurrent.ThreadPoolExecutor.ensureQueuedTaskHandled(ThreadPoolExecutor.java:758)
> 	at
> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:655)
> 	at
> org.drools.reteoo.PartitionTaskManager.enqueue(PartitionTaskManager.java:75)
> 	at
> org.drools.reteoo.AsyncCompositeObjectSinkAdapter.doPropagateAssertObject(AsyncCompositeObjectSinkAdapter.java:49)
> 	at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
> 	at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:147)
> 	at
> org.drools.reteoo.PartitionTaskManager$FactAssertAction.execute(PartitionTaskManager.java:188)
> 	at
> org.drools.reteoo.PartitionTaskManager$PartitionTask.run(PartitionTaskManager.java:112)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:619)
>
>    





More information about the rules-users mailing list