[keycloak-user] Performance lag in client role creation and retrieval

Padmaka Wijaygoonawardena teknodjs at gmail.com
Thu Nov 3 07:16:42 EDT 2016


I'm currently using Keycloak 2.2.1 with a MySQL database. The setup I'm
using has 2 Keycloak nodes and around 4000 client roles for one client. the
process I go through for adding is as follows:

   1. GET call to check whether the role already exists. (takes around
   2. POST call to create the new client role. (takes around 10000ms)
   3. GET call to get the newly created client role(Since the create role
   call doesn't send the full client role in the response body). (takes around

The Keycloak version I used earlier was 1.9.0 with that version this
process worked fine with one call taking around 700ms on average.

So as shown above this is a huge performance lag. With further
investigation I found the following points

   1. When using only one Keycloak node this problem doesn't appear.
   Therefore it should be some issue with infinispan cache.
   2. When I remove the get calls and only send the create calls then the
   calls return in 2000ms in average.
   3. This lag only appears when executing a get role call soon after
   creating a client role.

I double checked the changes for 2.3.0 [1] since there is nothing said
about cache or related issues I raised this issue.

Any advice or fix would be highly appreciated. Thanks in advance.

[1] - http://blog.keycloak.org/2016/10/keycloak-230cr1-released.html


More information about the keycloak-user mailing list