Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When realm count reaches around 470, Keycloak basically becomes unstable

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.

like image 353
lkamal Avatar asked Jan 31 '19 16:01

lkamal


1 Answers

There has been some opened issues on this for quite a while:

  • https://issues.redhat.com/browse/KEYCLOAK-6826
  • https://issues.redhat.com/browse/KEYCLOAK-6535
  • https://issues.redhat.com/browse/KEYCLOAK-4593
  • http://keycloak-user.88327.x6.nabble.com/keycloak-user-Keycloak-Performance-with-large-number-of-realms-td3853.html
  • https://lists.jboss.org/pipermail/keycloak-user/2016-October/008061.html

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.

like image 165
nunohpinheiro Avatar answered Nov 18 '22 12:11

nunohpinheiro