The number of connections is probably set to the default value of 50 in these type of environments.
Have a look here to change the settings of the database connections: https://docs.mendix.com/refguide/tricky-custom-runtime-settings#4-the-number-of-database-connections
Forcing the closure of connections is not an option AFAIK. The amount of memory available to handle database actions can influence the pool filling up slower or more quickly. An additional thing to keep in mind is the complexity of pages, pages with lots of references (set) selectors will have a negative impact on the database connections usage.
I will try explain this based on my recent performance issues experience.
http://www.craigkerstiens.com/2017/09/18/postgres-connection-management/
Bit more details
Identifying
So, its all related together. Hope this information helps.
Hello,
I’m also seeing database connections hit high values with only 2 users testing in my app. (25connections out of max 50)
How can this problem be narrowed down? What tools besides the Metrics screen can I leverage to help find the culprit causing these spikes?
Side Question:
Looking at the database connections graph in Metrics, are connections re-used across users? or is it per user? and are these connections all active? or is it both active/inactive connections being shown..
Having 25 connections open with only 2 users, would easily hit max 50 if connections remain open and another 2 users login..
At a high point, our app sees 30-40max users signed in at a time.