Performance question on the DbPersistedEngine (embedded)

When running the embedded InMemoryEngine, it will launch and complete 1000 workflows in about 10 seconds in my dev environment. If I attempt the same task with the embedded DbPersistedEngine, it is drastically slower. It could take much longer than an hour to launch/complete the 1000 workflows.

I use the following code to "launch" the 1000 workflows.
"rmiwrapper" is my interface to an RMI object which has access to the Engine thread. I've tested with RMI and without—it makes a very small difference ( <9% performance hit) .

         String wf =
              "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
           + "<process-definition name=\"ganbate\" revision=\"0.0\">"
               + "<sequence>"
                   + "<participant ref=\"DoNothing1\" />"
                   + "<participant ref=\"DoNothing2\" />"
            + "</sequence>"
           + "</process-definition>";
            
           long now = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
        LaunchItem li = new LaunchItem();
        li.setWorkflowDefinitionUrl("field:__definition__");
        li.getAttributes().puts("__definition__", wf);
        System.out.println("Launched:" + i);
        FlowExpressionId feid = wrapper.launchWorkFlow(li, true);
}



Both of my "DoNothing" participants merely have the "consume" method that just System.out's something and then replies to the engine.
...
    public void consume (WorkItem wi)
    throws Exception
    {
        count++; //static var
        System.out.println("Finished" + count);
        replyToEngine((InFlowWorkItem)wi);
}
...
My RMI impl object contains:
this.engine = new DbPersistedEngine("Engine1", con, false);
(con is my DB connection)


Is this large of a performance hit typical of the DbPersistedEngine? Or does it sound like I have something drastically wrong?
What are some ways I could increase its throughput? I expected a somewhat slower response time—but not to this degree. Any thoughts on the matter are appreciated. I am unsure of this result is normal.


Thank you!

~Aiko

Reply via email to