Hey, thanks for the reply.
The bulk of the time is being spent in the job executor when trying to aquire new jobs, within the queries "selectNextJobsToExecute_mysql" and "selectExclusiveJobsToExecute_mysql". Extracting the actual queries and params out using debugging and running in a MySQL client yields very similar results, give or take a second.
The included sub-process is a no-op that was just added for testing, just a simple log statement. Changing it to a script task and/or removing it yields the same overall result.
For brevity I've simplified the code below, but the processes are started by essentially the following inside of a java class (main and/or embedded in a webapp).
for(int i = 0; i < numProcesses; i++) {
final Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put("ID", String.valueOf(i));
variableMap.put("nextDate", isoDateString);
runtimeService.startProcessInstanceByKey("testProcess", String.valueOf(i), variableMap);
}
Also noticed that when starting up a new node in a cluster and deploying processes, there is a "selectJobsByConfiguration" query which gets executed, which also results in a very long startup time for the process being deployed in a new JVM.