DB Connection Pool Limit?

I need to understand how Jmix (Spring?) manages database connections - specifically when are they created/closed and how a limit can be set.

My Jmix application is using a cloud hosted MySQL DB with a limit of 10 connections. Currently there is no one logged in or using the application, yet the DB is at the max 10 connections and other DB tools like Workbench are not able to connect.

How many connections should I plan for per user? For example, if I need to support 10 concurrent users plus additional stuff like async email sending, occasional quartz jobs, and some REST requests.

Bump. Asking questions on the weekend can cause your post to get lost in the pile :grinning:

Jmix and in Spring Boot in general uses HikariCP for a connection pool.
You can set its properties in application.properties with main.datasource.hikari prefix, for example:

main.datasource.hikari.maximum-pool-size = 100

The list of available properties see in Hikari docs, just replace camelCase with kebab-case.

See also Spring Boot docs, but for property names use main.* (or additional data store name) instead of default spring.*.

How many connections should I plan for per user? For example, if I need to support 10 concurrent users plus additional stuff like async email sending, occasional quartz jobs, and some REST requests.

It depends on how often they acquire connections and for how long. For example a pool of 10 connections can easily serve 100 users if they execute short transactions not too frequently.

In your case, 10 connections should be enough.

Thanks for the response - that gives me the info I need to set the limit and continue learning more about how it works.