2 Replies Latest reply on May 28, 2009 9:05 AM by Sindre Hamlander

    (Excessive?) Drools class loading in ContentBasedRouter (CBR

    Sindre Hamlander Newbie

      Hi,
      I have been running a CBR test with 200 clients each sending 5KB messages through the system. The test scenarios look as follows...

      HttpClient -> ESB(4.4.GA_FP_r26027)-> EchoWebService

      I have two test scenarios on the ESB. The first passes the client HTTP requests directly to the EchoWebService. This works as a benchmark for further testing. The second scenario expands on the first by adding a CBR action. This action evaluates one XPath expression.

      Comparing my performance results between these two scenarios, I am seeing a significant performance drop when adding the CBR action. I was expecting a performance drop, but not as significant as this. After pointing a profiling tool at the CBR scenario I found that Drools is trying to load a huge amount or resources (using the ClassLoader) on every request. More than 170 for each invocation going through the system. This resource loading seems to take up about 14% of the servers processing time on my hardware. Given that we are using stateless Drools in the CBR is this expected behaviour?

      We expected the resources to be loaded only once on the first invocation. Is this a fair assumption to make?

      I can attached a PDF file which lists out the hotspots in the server if anyone is interested.

        • 1. Re: (Excessive?) Drools class loading in ContentBasedRouter
          Kevin Conner Master

          It sounds as if there is something wrong somewhere.

          Can you provide a stack for the resource loading? We can take a look and see if it is something we are doing or something inherent in drools.

          Thanks

          Kev

          • 2. Re: (Excessive?) Drools class loading in ContentBasedRouter
            Sindre Hamlander Newbie

            Here is the stack of the resources being loaded.

            Inherent time: 68,033 ms (14 %)
            Average Time: 34 Microseconds
            Invocations: 1,953,902
            java.util.Enumeration.hasMoreElements
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.mx.loading.UnifiedLoaderRepository3.getResources
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.mx.loading.RepositoryClassLoader.findResources
            13.6% - 62,817 ms - 1,808,208 hot spot inv. java.lang.ClassLoader.getResources
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.util.ChainedProperties.getResources
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.util.ChainedProperties.
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.util.ChainedProperties.
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.util.ChainedProperties.
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.SessionConfiguration.init
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.SessionConfiguration.
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.reteoo.ReteooStatelessSession.newWorkingMemory
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.drools.reteoo.ReteooStatelessSession.execute
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRules
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRules
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter.route
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.actions.ContentBasedWiretap.executeRules
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.actions.ContentBasedWiretap.process
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.actions.ContentBasedRouter.process
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process
            13.6% - 62,817 ms - 1,808,208 hot spot inv. org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run
            13.6% - 62,817 ms - 1,808,208 hot spot inv. java.util.concurrent.ThreadPoolExecutor$Worker.run