The CG overhead limit exceeded error is explained in the documentation here, and it lists some common causes for your application. If you want to debug this issue, I wrote a post about that pretty recently here.
Looking at your recent posts, however, it may be that you are trying to run your application with too few resources for the number of concurrent users and specific setup. I would suggest increasing resources (most notably application memory) to resolve this issue quickly, so that you have time to debug the issue. If you deploy in the Mendix Cloud, you can contact support or your Customer Success Manager to increase resources. If you deploy on premises, you should contact your own team.
There are no hard and fast rules for deciding the optimal amount of memory and the size of the connection pool. Usually, I increase the memory of an app when I see out of memory issues. If the memory issues persist, I start debugging the find the cause. I would follow the same approach for the connection pooling issue.
Finally, if you are unable to resolve this yourself, you can always ask Mendix Expert Services for support, although they do charge a fee to help you out in such cases.
I will try to provide my experience on the same. Hope it will help you.
When users are using the system, DB connections are required and made. When more requests comes in:
Solution could be, as you already figured out
There is no hard and fast rule to find out the equation to arrive at the numbers. But despite the measures taken to increase DB Connections and INFRA, its good to spend time in analyzing logs to find out, what is causing the usage of DB connections. In my personal experience, the way the product is built, ended up with complicated query which takes a lot of time to execute the query, which holds the connections active for long time.
Raise a Mendix support support ticket and ask them to provide DB logs. When you analyse that, it might help you to find long running queries. But for this, you must first enable a constant to log the long running queries. https://docs.mendix.com/refguide/tricky-custom-runtime-settings#3-query-logging