I have a question related to Keycloak and would like to thank you in advance for any advice.
I deployed Keycloak (version 20.0.5) in the context of an Azure Container Instance (CPU: 1, Memory 1,5 GB), and its related database is a SQL database (Pricing tier: Standard S0: 10 DTUs) which is also deployed on Azure.
Most of the time, the connection between Keycloak and the SQL database works, but regularly, I observe the following logs:
2024-06-26 10:20:36,971 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (Timer-0) SQL Error: 0, SQLState: null
2024-06-26 10:20:36,971 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (Timer-0) Acquisition timeout while waiting for new connection
2024-06-26 10:20:36,972 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-0) Failed to run scheduled task ClearExpiredUserSessions: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
That exception occurs every 30 minutes, sometimes just every hour. This leads to a failed connection for ~2 minutes. After that, everything is fine.
My question is whether you have any advice, instruction, or whatever could help me to determine what this connection problen causes:
• Am I using the wrong pricing tier combination (ACI: SKU == Standard, SQL == Standard), I already upgraded the SQL from Basic to Standard
• Could it be a problem due to the Pool Size? (I didn’t configure that, I’m using the default one)
• Could it be that there are too many connections/sessions request to the SQL? Although I should not exceed the limits (see below)
• Is there anything, which might happen inside the Keycloak Container due to a configuration mistake?
• Is maybe an Azure Container Instance not ideal for running Keycloak? Can some of those connection problems occur when maybe the Container is moved to a different cluster?
Thank you!