We are having a Keycloak 4.8.1.Final deployed on a k8 cluster with two nodes with default settings. Backend database is PostgreSQL.
We are increasing the number of realms in Keycloak to figure out if Keycloak can support a larger number of realms; these creations are done sequentially.
However, when the quantity of realms reach around 470, it makes keycloak basically unusable with admin GUI not loading at all and requests taking too long to execute.
Below is a summary of the time taken. We have not added any users into the realms.
+--------------+----------+------------+------------+------------+
| Operation | 0 realms | 100 realms | 250 realms | 350 realms |
+--------------+----------+------------+------------+------------+
| Create realm | 1104 | 3739 | 8659 | 11535 |
| Get realm | 128 | 961 | 3067 | 3853 |
| Get token | 636 | 1159 | 2714 | 3197 |
| Get roles | 127 | 1037 | 3034 | 3649 |
+--------------+----------+------------+------------+------------+
Are there any known limitations or an optimal number of realms for a Keycloak deployment?
Already raised in user group as well.
There has been some opened issues on this for quite a while:
From what I recall, several sources point out that decrease of performance at about 400 realms. However, none of the issues above seem to have already been effectively tackled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With