We are running a dockerised springboot Camunda 7 instance running in AWS. We configure it using an application.yaml file but it seems to be ignoring some of the configuration. Part of the config looks like this:
camunda.bpm:
history-level: FULL
history-level-default: FULL
job-executor-acquire-by-priority: true
job-execution:
enabled: true
max-pool-size: 40
core-pool-size: 20
deployment-aware: true
In AWS we have it configured to run 4 nodes so I expect a minimum of 80 execution threads and hence 80 database connections - scaling up as needed to 160 threads and connections.
When we run this under a very heavy load and look at the RDS instance we only ever see 40 database connections which seems to imply that we are using only the default number of execution threads.
The RDS datasource is configured with a connection pool size of 200.
Take a look at AWS monitoring to check if RDS is reaching the maximum number of connections or close to it, or any additional information you may have in this monitoring.
Also check if your loadbalancer is correctly distributing requests.
The yaml file you pasted does not have proper indentation. May be indentation is lost when you pasted in Camunda forum . If you have similar indentation in actual file then it is the issue.
Now if your indentation is correct then database connection has different settings for pool size. Default pool size is 10 and if you wish to set then you can use below configuration :
spring.datasource.hikari.* properties
spring.datasource.hikari.maximum-pool-size
equivalent OS env variables (preferred way)
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE
Please refer to official springboot/hikari documentation for more hikari configs.
The application is deployed in a Docker container in AWS ECS and configured to run with 4 servers. Given the max-pool-size is set to 20 I would expect 80 database connections at least under very heavy load but I only ever see 40 (the default pool size * 4 servers)
The problem is that I have 3 different database connections at any time. As a result, I build the Hikari data sources manually in a configuration class (the password is encrypted and needs to be sourced separately):
@Bean(name = "camundaBpmDataSource")
@Primary
@ConfigurationProperties(prefix = "spring.datasource.bpm")
public DataSource bpmDataSource() {
HikariDataSource hikariDataSource = new HikariDataSource();
hikariDataSource.setPassword(this.bpmPassword);
return hikariDataSource;
}
SpringBoot is very opinionated when it comes to configurations. If you donot want to do it default springboot way then probably you have dig SpringBoot’s official documentation on how to configure Pool settings programmatically .