0

Let's consider I have two Spring boot applications.
And say each configures 50 max-active connections.
Say that both are deployed to external Tomcat container and embedded Tomcat container is disabled in both.

What will be the connection pool behavior?

  1. Will each application create its own connection pool with max 50 active connections?
  2. Will there be one common connection pool of max 100 active connections?

What is recommended for such connection pools in such multiple Spring boot application deployments to same Tomcat server container?

Chetan Yewale
  • 192
  • 4
  • 16
  • 2
    OPtion 1 as each application has its own pool defined. So 2 will not happen. What is recommended isn't easy to answer as **it depends**... – M. Deinum Sep 30 '20 at 13:36
  • @M.Deinum, thank you for the answer. So, each application creates its own pool. So, if I have too many applications in same Tomcat server, its likely that my Java heap space (configured using -Xmx) may get filled soon.. Am I correct in assuming so? I think The Java heap space that we configure for Tomcat will be shared between all the Spring boot applications. – Chetan Yewale Sep 30 '20 at 13:52
  • Why would the heap space run out if each creates connections? – M. Deinum Sep 30 '20 at 13:57
  • I maybe wrong. My thought process is: one application reserves some heap for its own connection pool, other applications also do the same. Now, if heap space configured for tomcat is shared among all applications, then heap space is likely to be filled under load. Let me know if heap space is shared among all applications in Tomcat container – Chetan Yewale Sep 30 '20 at 14:00

0 Answers0