[rules-users] Drools-Guvnor ­ question about build and deploy packages

Vincent LEGENDRE vincent.legendre at eurodecision.com
Tue Apr 19 13:56:04 EDT 2011


I don't think that having one binary package per rule will solve your problem, as you will build you KB by merging some packages, and will then fall into exactly the same "compilation" time (to merge common nodes and build the merged RETE for your packages).

Note than this problem is exactly the same in other rules systems (compilation takes times, in order to save time at execution).

May be you should consider modifying your rules, for instance by creating some more generic rules that take a condition that will match some parameters in working memory, and then stream and persists these parameters into a "kept-alive" session ? This way, no more frequent compilation needed, only when you change your generic rules. But I dont know your rules, so I don't know if it is feseable ...

May be you can arrange you rules in smaller packages and call them in sequence (by creating as many sessions as packages), and thus updating (ie compile) only the modified (and smaller) package ?


----- Mail original -----
De: "Patricia Bogoevici" <patriciabogoevici at yahoo.com>
À: "Rules Users List" <rules-users at lists.jboss.org>
Envoyé: Mardi 19 Avril 2011 18:22:17
Objet: Re: [rules-users] Drools-Guvnor ­ question about build and deploy packages


Thanks David for your reply. 


To clarify: the performance problem is specifically related to the build package. This task takes longer as the package has more and more rules. The build package process is complex, and performs also rule validation. That's why I asked if there is a way to incrementally update the package binary. 


The app I am working on, we streamlined the process of creating a new rule, including building and deploying a new snapshot package to propagate the changes quick. Because the build task takes longer (as the package has more and more rules), it is a problem for the end user, as it feels that nothing happens for a while when saves a rule. 


Once the new snapshot package is created, the KnowledgeAgent propagates the updates into the app without problems. 


So, coming back to the build package task: 
what is the best strategy to create snapshot packages, so that the build time does not take a long time when there are lots of rules in the package? 


One possible solution I see, is to create a snapshot package for each rule within a package, using a custom selector. I haven't tried it, but this approach will keep the build time short. However, it doesn't seem natural to me to have so many snapshot packages... 


thanks, 
Patricia 




--- On Tue, 4/19/11, David Faulkner <david.faulkner at amentra.com> wrote: 



From: David Faulkner <david.faulkner at amentra.com> 
Subject: Re: [rules-users] Drools-Guvnor ­ question about build and deploy packages 
To: "Rules Users List" <rules-users at lists.jboss.org> 
Date: Tuesday, April 19, 2011, 11:51 AM 



Patricia, 


My understanding (which is certainly open to being corrected) is that in general there is no way to do an incremental compilation of rules. The entire package is analyzed together and significant optimizations are performed to combine common items between rules (which is one of the big reasons why the engine executes so well!). So, generally, what you are doing is the "best practice". 


When you say that you are experiencing a performance hit, are you talking about a delay in seeing the updates appear in your production application, or something else? Generally, the compilation is a one-time step, and even during compilation your enterprise application that is actually using the rules should continue to perform quite reasonably, since the compilation is going on in a separate application. 


David 


From: Patricia Bogoevici < patriciabogoevici at yahoo.com > 
Reply-To: Rules Users List < rules-users at lists.jboss.org > 
Date: Tue, 19 Apr 2011 10:45:59 -0500 
To: Rules Users List < rules-users at lists.jboss.org > 
Subject: [rules-users] Drools-Guvnor – question about build and deploy packages 





I am using Drools-Guvnor 5.1 release in an enterprise application. The rules created are separated per packages, and for each package there is a snapshot package called LATEST. The KnowledgeAgent polls the snapshot packages to get the latest data and load into the rule engine. Whenever there is a new rule, or updates to an existing one, the application triggers the process of re-creating the package snapshot: builds all the rules within the package, and creates a new snapshot for the package. 




The main problem with this approach is that the time to build the package rules, increases quite a lot as the number if rules gets higher. This creates a serious performance hit in the real-time app whenever there is a change to the rules. 




I sneaked a bit to the source code, and noticed that when build package is called, Guvnor builds a new binary for all the rules within a package even though not all of them are modified. Would it be possible to incrementally create/update the package binary? This would speed up things a lot when the package has lots of rules but only one rule changes at the time. 




What is the best approach for creating the package snapshots? The approach we've taken is to build all the rules within a package into one snapshot, and we ran into this performance issue. 




Any ideas/suggestions is much appreciated. 




Thanks, 

Patricia 
-----Inline Attachment Follows----- 


_______________________________________________ 
rules-users mailing list 
rules-users at lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list