Springboot configuration

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.

So…

  1. Are are missing something in the config?
    or
  2. I am not interpreting this correctly?

Thanks
Mike

Hello my friend!
Welcome to fórum again :grin:

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.

William Robert Alves

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.

In fact, if the yml file is not correctly indented, forming a kind of “chained structure”, it will not behave properly.

Unless you removed the spaces when posting here on the forum.

If you could take a screenshot of your yml file so we can check, at least this part you posted, that would be great.

William Robert Alves

Screen captures from config yaml.

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)

@mike_g Your configuration seems incorrect to me. bpm is not need in db configurations .

I feel It should be like

spring.datasource.driver-class-name
spring.datasource.hikari.minimum-idle
spring.datasource.hikari.maximum-pool-size

References :
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#data.sql.datasource.configuration

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#application-properties.data.spring.datasource.hikari

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 .