0

I have two Spring boot applications deployed on wildfy. In each application uses hikaricp, with max pool size 20. On high load i see, that my first application uses all connections from pool (active counts 20), second application uses only 4 (active counts 4), but when second application try to get connection it had an exception: Connection is not available, request timed out after 30000ms. Is it possible that second app try to get connection from first app cp?!

Evgen
  • 1
  • 1
  • 1
    No, but it is possible for your connection pool to be larger, or for your first app not to hog all available connections. – user207421 Nov 03 '19 at 09:24

1 Answers1

1

I'll consider two cases and share what I know:

  1. Both applications on same application server (Wildfly)

If you have a common connection pool definition in the application server, then sure, both applications share the connection pool.

Note: Though it seems to me that this is not the case, as I'm not certain about your deployment architecture. So, let's look at the next possibility.

  1. Each application on an isolated connection pool (separate servers)

One application cannot access or be limited by another application's connection pool.

What might happen though is that you're running out of physical database connections - the connection pool at the application level opens physical connections to the database. Both your application's connection pools are doing that. Each database system has a configuration that sets the max (physical) connection limits - how many physical connections can clients make to the database at a time.

For example, in MySQL you can find and modify the max_connections configuration parameter as shown here.

Some information about physical vs logical connections can be found here.

priyank-sriv
  • 1,094
  • 6
  • 12