cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Drools performance

Former Member
0 Likes
1,027

Hi all,

Currently on my project, we are on hybris 6.3 using drools engine for promotions, we have 700+ published promotions, and the engine is having troubles updating the cache when we archive promotions,

Is there a recommended usage / tuning / configuration for drools to be used as intensively as this?

Notice that we have only a two core server, and about 16 GB of ram

View Entire Topic
0 Likes

Hello, it's important to archive the promotions that is not being used. But, if you are unable to archive lots of promotion, you can upload an ImpEx deactivating the Drools Rules, that are compiled lots of times. I wrote an idea in the forum about it (https://experts.hybris.com/content/idea/99428/view.html). Summing up, you can take the PK of the drools rules that correspond to old promotions with the query:

  SELECT {dr.pk} FROM {PromotionSourceRule AS pr JOIN DroolsRule AS dr ON {pr:code} = {dr:code}} WHERE {pr:enddate} < current_timestamp AND {dr.active} = '1' AND {dr.currentversion} = '1'

And make an ImpEx with the header

  UPDATE DroolsRule;pk[unique=true];active;

Filling the pk field with the result of the query and setting 0 to the active field (that will deactivate them).

Former Member
0 Likes

Thank you!

This is a good workaround for a cronjob / groovy script / impex script to automate the amount of unnecessary promotions within drools

We ended up removing them using a similar approach over a groovy script, but it didn't decrease the risk of the caché not updating due to the heavy creation / update / deletion of promotions on the engine u.u

0 Likes

Nice, good to know that we faced the same issue and we used similar solutions to get around this. If my answer fits your question, could you please accept it?