Repository navigation
Replies: 1 comment 6 replies
|
@rcollette - did you find any workaround for the problem? we are getting same issue during load testing. keycloak is not respecting the --db-pool-max-size command line parameter. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In load testing we are hitting a "Too many connections" error when our HTTP request concurrency reaches the configured number of database connections in the the pool via the KC_DB_POOL_MAX_SIZE setting.
Test Setup
We observe in the AWS console that the database active connections maxes out at 62 connections.
At peak we see that there are "Too many connections" errors logged by Keycloak, which on the one hand probably indicates we need to make the connection pool smaller even though it is already smaller than MAX_CONNECTIONS but I would expect see far more HTTP requests being handled than the number of database connections in the pool.
If we change the test to run three clients with 15 threads each we see no errors.
It appears as though perhaps database connections are being established for the lifetime of the HTTP request, rather than opening and closing the connection for just the operations that involve the database. Typically database operations only require a small fraction of the overall request time and connections should be closed as soon as possible so that pooled connections can service many more HTTP requests than there are connections available.
Is there a way to improve this behavior to more effectively utilize available database connections? I have searched all content for "Too many connections" and "pool" and have not been able to find any guidance other than a request to allow configuration of request/worker thread pooling in https://github.com/keycloak/keycloak/issues/15224fa
All reactions