HikariCP question

I set the spring.datasource.hikari.maximum-pool-size=30 but it defaults to 10. It works fine locally but not when application is deployed which is odd. Any debugging tips here on why it defaults to 10 instead of overriding this to the value I set?
20 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Kale Vivi! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
KSHITIJ
KSHITIJ6mo ago
Add screenshot if possible
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Ankit
Ankit6mo ago
In Spring Boot applications, configuration properties can be externally overridden at runtime through various mechanisms. While a value like spring.datasource.hikari.maximum-pool-size=30 may be correctly defined in your local application.properties or application.yml, it might not take effect in production due to the Spring Boot property resolution order.
dan1st
dan1st6mo ago
If people want an LLM answer, they can typically just ask an LLM Do you have multiple application.properties files? Do you use any environment variables? Are you using Spring config server? Are you using any CLI arguments? Any JVM arguments (system properties)?
Kale Vivi
Kale ViviOP6mo ago
Yes I have multiple application property files. Yes I use environment variables and the active profiles are default to the correct ones (like dev, prod, etc..) what is Spring config server though? yeah jvm args and cli but it's an issue with the environment not being set properly, just the poolside not being overriden Like if I use a poolsize of 30 for all envs, in local, it's 30 but in dev, test and prod it's 10 one thing I noticed if I set a custom pool name in local, it picks up the new pool name but in the other envs, it uses the HikariPool-1 which is just the default I'm not sure why it just defaults to HikariPool-1 over the pool I specified
dan1st
dan1st6mo ago
A spring project like Spring Web or Spring Security that allows you to load configuration from a config server
Kale Vivi
Kale ViviOP6mo ago
I mean we're using spring boot and spring security
dan1st
dan1st6mo ago
Can you run the server with the production profile locally? for testing Where are you setting the pool size exactly? Do you have any JVM arguments that start with -D? Or environments that start with SPRING_? Are you using Spring actuator?
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Kale Vivi
Kale ViviOP6mo ago
Yes I can but this issue even happens for lower envs, like dev (just not local), so I can point to dev to see if it's reflected accordingly. The only thing is our db is on the cloud, so we setup a sesionforward to the db. I'm wondering if the db being on the cloud in higher envs might be a contributing factor like we have a data source that overrides hikaridatasource poolsize is set in the application properties but introduce a new bean to manually set the poolsize for the datasource
dan1st
dan1st6mo ago
try reproducing it locally with a different profile
Kale Vivi
Kale ViviOP6mo ago
and still same issue I do have JVM args with -D like the spring active profile
dan1st
dan1st6mo ago
and also check the application.properties files for each of the profiles
Kale Vivi
Kale ViviOP6mo ago
yes I'm using spring actuator I'm seeing the wrong pool size in the metrics endpoint and the log message when app starts up
dan1st
dan1st6mo ago
I think there's an actuator endpoint that gives you all the properties and one giving you all the beans
Kale Vivi
Kale ViviOP6mo ago
I did, it's the right value I want but spring doesn't respect that override what's the difference between the two?
dan1st
dan1st6mo ago
beans are objects managed by spring properties are these things you put in the application.properties or similar check it
Hammy
Hammy6mo ago
hmm
JavaBot
JavaBot6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?