I am using hikari with spring boot, local testing I can see 50 active connections. After I deployed to cloud foundry , I am only able to see 10 active connections.
spring.datasource.hikari.maximum-pool-size=50
Seems like cloud foundry bind service is trying to overwrite my application's configuration. How can configure this number in cloud foundry?
maybe someone get help from this link, it says if you are running serious application in production , you need to configure DataSourceConfiguration
https://spring.io/blog/2015/04/27/binding-to-data-services-with-spring-boot-in-cloud-foundry
If you are including
spring-boot-starter-cloud-connectorsin your project, then the Spring Boot database properties aren't used. Spring Cloud Connectors will create and configure theDatasourcebean automatically, unless you write the Java code to manually configure it.As you found in the Connectors docs, you can write code like this to configure the connection properties, including pool size.
If you want to use Boot properties instead of writing code like this, you can remove
spring-boot-starter-cloud-connectorsfrom your project and configure the Boot properties using thevcapproperties provided by Boot when apps are run on CF. Yourmaximum-pool-sizeproperty should be honored if you configure the connection in this way.