开发者

Parallel processing in Drools

开发者 https://www.devze.com 2023-03-13 19:07 出处:网络
just wondering if trying to increase maxThreads configuration for drools speeds up processing time or not? At the moment I am using StatelessKnowledgeSession with the following settings:

just wondering if trying to increase maxThreads configuration for drools speeds up processing time or not? At the moment I am using StatelessKnowledgeSession with the following settings:

Drools: 5.1.0.M1
-XX:MaxPermSize=256m 
-Ddrools.maxThreads=5 
-Ddrools.conflictResolver=org.drools.conflic开发者_Python百科t.FifoConflictResolver 
-Ddrools.shadowproxy=false

It doesn't seems to improve the performance much, seems to be the same without them. Any suggestions?


maxThreads property is for internal use of the framework, it is useful if you have a huge set of rules that can be split into partitions.

Here is an example of what you could do if you want to be more scalable on data processing:

The idea is that the KnowledgeAgent or KnowledgeBase (it depends on your use) is thread safe. This means that you can share it between multiple threads. On each thread you can invoke a Session (stateless or stateful) that will be local. Keep in mind that Sessions are not thread-safe. This way, you can become scalable if you have a huge data load.

You can for example use Producer/Consumer design pattern if you wish to implements scalability over Drools.

0

精彩评论

暂无评论...
验证码 换一张
取 消