[rules-users] Parallelization

djb dbrownell83 at hotmail.com
Tue May 11 04:40:41 EDT 2010


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)

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parallelization-tp809341p809341.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list