2 Replies Latest reply on Nov 21, 2012 5:08 AM by Sachin Francis

    How to measure the performance of JBPM

    Sachin Francis Newbie

      hi all

       

      Say,

       

      if i need to create some lakhs of processes, say for performance testing, should i use a single session for concurrent threads(1000) doing creation of processes.

      I have enabled persistence with oracle 11g, no history logging.

       

      My doubt is

      In sessioninfo table, as last notified time is updated for every process completion. This could be a bottleneck for me r8?

       

      So,

      Should i create all processes in same session or for ech process creation should i start new session. And is there any option to avoid the session last notified time getting updated

       

      Becuase without persistence for my scenario i get a tps of around 2200 and with persistence just 20 and response time keeps increasing.

       

      I am using JBPM 5.2

       

      I am beginner and hope u could help me,

        • 1. Re: How to measure the performance of JBPM
          Mauricio Salatino Master

          You can create a session per process, so you avoid having the session bottleneck. Each session will contain just one process.

          I've created a set of tests with the different approaches, but I'm not measuring performance, so I guess that there is a lot of fine tuning to improve the times.

          https://github.com/Salaboy/jBPM5-Developer-Guide/tree/master/chapter_11

           

          One important question that I usually ask is: Do you really need to create 2200 process per second? It doesn't sounds like a business requirement from my perspective. Let's say that you are working for a big company that can sell 2200 items per seconds, you are not planning to solve all those cases with just a single machine do you?

           

           

          Cheers

          • 2. Re: How to measure the performance of JBPM
            Sachin Francis Newbie

            But when i try to do it in multiple sessions, i mean a session per PI, i get the following error.

             

            ERROR hibernate.util.JDBCExceptionReporter.logExcepti
            ons  - Closed Connection
            56   21/11 14:14:04,586[http-8061-Processor23] ERROR drools.persistence.SingleSessionCommandService.
            rollbackTransaction  - Could not commit session
            javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not get
            next sequence value
                    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManag
            erImpl.java:614)
                    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
                    at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17)
                    at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.jav
            a:152)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
            39)
                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
            pl.java:27)
                    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreSe
            rviceImpl.java:129)
                    at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(Knowledg
            eStoreServiceImpl.java:67)
                    at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeSe
            rvice.java:122)
                    at com.comp.bpm.test.util.JBPMManager.createAndProcessWithSetVariable(JBPMManager.java:82)

                    at org.apache.jsp.jsp.createProcess_jsp._jspService(createProcess_jsp.java:82)
                    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
                    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
                    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
            ava:269)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
                    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Htt
            p11BaseProtocol.java:665)
                    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
                    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.ja
            va:81)
                    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
                    at java.lang.Thread.run(Thread.java:619)
            Caused by: org.hibernate.exception.GenericJDBCException: could not get next sequence value
                    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.j
            ava:126)
                    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
                    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
                    at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:119)
                    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventLi
            stener.java:122)
                    at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventList
            ener.java:49)
                    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEvent
            Listener.java:154)
                    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener
            .java:110)
                    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener
            .java:61)
                    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
                    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
                    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
                    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
                    ... 31 more
            Caused by: java.sql.SQLException: Closed Connection
                    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
                    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
                    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197)
                    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
                    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:269)
                    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:490)
                    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3127)
                    at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042)
                    at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
                    at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:145)
                    at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
                    ... 40 more

             

            ERROR event.def.AbstractFlushingEventListener.perfo
            rmExecutions  - Could not synchronize database state with session
            org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsav
            ed-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#346]
                    at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java
            :1782)
                    at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.jav
            a:2541)
                    at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.jav
            a:2715)
                    at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
                    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
                    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
                    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
                    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingE
            ventListener.java:321)
                    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:
            50)
                    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
                    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
                    at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.
            java:504)
                    at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:478)
                    at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:193)
                    at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
                    at org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)
                    at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.ja
            va:348)
                    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedSta
            tefulKnowledgeSession.java:223)

             

             

             

             

             

            The method which is call for creating the process is

             

            public static long createAndProcessWithSetVariable(String id,Map<String, Object> assigneeList) {

            StatefulKnowledgeSession

            ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase,null, env);
            ProcessInstance pid = ksession.startProcess("billing", assigneeList);
            ksession.dispose();
            return pid.getId();
            }