Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-3412

Performance degradation with session pools

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • 2018 Week 48-50
    • NEW
    • NEW

      Hello,

      We've today updates to Drools 7.15 and as discussed with DROOLS-3228 we changed our code from calling StatefulKnowledgeSessionImpl.reset ourselves to KieSessionsPool. However we then recognized that our application quickly became slower and slower over time (roughly after a few minutes of uptime, or a couple of hundred session create/dispose cycles).

      I haven't yet found the reason what is causing the slow down. However I think there is a difference in how we reset our sessions before session pools and how session pools do it. Perhaps that is a lead.

      What we did

      1. Create a session
      2. Use the session
      3. Dispose and reset the session and go back to 2 for the next facts

      What happens with session pools

      1. Create a session
      2. Use the session
      3. Skip dispose (because of pool != null in the dispose method), reset the session and go back to 2 for the next facts

      So the difference seems to be that with session pools the session doesn't get disposed before reset it called. If I do the same without session pools then I also see the same slow down. So it seems that something is left behind and causes a slow down. The results however seem to be correct, so the right consequences appear to be triggered.

      An example on how we use the session pool can be found here: https://github.com/liebharc/JavaRules/blob/master/src/main/java/com/github/liebharc/JavaRules/StatefulReusingDroolsEngine.java

      Thanks once more for your help.

        1. gc.png
          82 kB
          Christian Liebhardt

              mfusco@redhat.com Mario Fusco
              christianl_jira Christian Liebhardt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: