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
⌛ This post has been reserved for your question.
Hey @Kale Vivi! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton 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.
Add screenshot if possible
💤 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.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.
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)?
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
A spring project like Spring Web or Spring Security that allows you to load configuration from a config server
I mean we're using spring boot and spring security
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?💤 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.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
try reproducing it locally with a different profile
and still same issue
I do have JVM args with -D like the spring active profile
and also check the application.properties files for each of the profiles
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
I think there's an actuator endpoint that gives you all the properties
and one giving you all the beans
I did, it's the right value I want but spring doesn't respect that override
what's the difference between the two?
beans are objects managed by spring
properties are these things you put in the application.properties or similar
check it
hmm
💤 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.