joewei (4) [Avatar] Offline
#1
We do run about 75,000 to 90,000 processes per day and the majority of them are depending on the job executor.

How can we configure the thread pool to increase the number of threads in a non-Spring environment ?

We are configuring Activiti programmatically as follows:


ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
processEngineConfiguration.setIdBlockSize(10000);
processEngineConfiguration.setDataSourceJndiName("jdbc/activitiPooledDS");
processEngineConfiguration.setTransactionsExternallyManaged(true);
processEngineConfiguration.setJobExecutorActivate(true);
processEngineConfiguration.setHistory(ProcessEngineConfiguration.HISTORY_ACTIVITY);
processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);

processEngine = processEngineConfiguration.buildProcessEngine();

Any help would be highly appreciated.

TIA
Joerg
tijs.rademakers (494) [Avatar] Offline
#2
Re: How to configure thread pool
Hi Joerg,

The ProcessEngineConfigurationImpl class provides a method (setJobExecutor) to set your own JobExecutor implementation. By default a new instance of DefaultJobExecutor is set. So to increase things like the queue and thread pool size you can create a new instance of the DefaultJobExecutor and set your values. Then use the setJobExecutor method to set this custom job executor before you execute the buildProcessEngine method.

Best regards,

Tijs
joewei (4) [Avatar] Offline
#3
Re: How to configure thread pool
Thanks for your quick response.

Would you mind giving me an example ?

Thanks and best regards
Joerg
tijs.rademakers (494) [Avatar] Offline
#4
Re: How to configure thread pool
Hi Joerg,

ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
DefaultJobExecutor jobExecutor = new DefaultJobExecutor();
jobExecutor.setQueueSize(10); // or another value
jobExecutor.setCorePoolSize(10); // or another value
processEngineConfiguration.setJobExecutor(defaultJobExecutor);
processEngineConfiguration.buildProcessEngine();

Best regards,

Tijs
joewei (4) [Avatar] Offline
#5
Re: How to configure thread pool
WOW, that was fast smilie

Thanks a lot Tijs
Joerg