3

Trying to investigate an issue regarding a keycloak deployment. From the documentation we're seeing that we should alter this property in the stanealone.xml to allow more

However , after altering the standalone xml to this

                </datasource>
                <datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true" use-ccm="true">
                    <connection-url>jdbc:postgresql://${env.DB_ADDR:postgres}/${env.DB_DATABASE:keycloak}${env.JDBC_PARAMS:}</connection-url>
                    <driver>postgresql</driver>
                    <pool>
                        <max-pool-size>200</max-pool-size>
                    </pool>

When we allow the JMX connection to the management console I notice this max pool size showing 19

Is there anything which could be overriding the max-pool-size setting we're using or how would one go about debugging where is derives the max-pool-size if not from the standalone.xml

1 Answers1

2

I don't know why exactly you get this issue but I'll try to help to the best of my abilities.

Keycloak 11 uses Widlfy 20, which offers several options to configure the datasource.

Please try to set

  • pool-use-strict-min to true
  • pool-prefill to true
  • min-pool-size to 200
  • initial-pool-size to 200

Also, monitor the number of opened connection on your Postgres database, and check if they recoup with the JMX report you got.

Finally, if none of these cause a change in your situation I can only suggest to try another ManagedConnectionPool implementation (see mcp attribute)

Olivier Tonglet
  • 3,312
  • 24
  • 40
  • Sorry I can't be more useful. Other options are to post an issue on the Keycloak issue tracker (https://github.com/keycloak/keycloak-community/issues) or ask a new question with the Wildfly tag and maybe some Widlfly expert on StackOverflow will be able to answer. – Olivier Tonglet Sep 14 '20 at 08:03
  • Accepting this as the answer because it contains helpful information and resources for further debugging. The issue on our end was actually it was using the standalone-ha.xml rather than the standalone.xml and was never noticed – Shane McGovern Sep 14 '20 at 10:14