2016-04-30 04:39:32 +00:00
2016-04-28 23:31:06 +00:00
=== Eviction and Expiration
2017-08-28 12:50:14 +00:00
There are multiple different caches configured for {project_name}.
2016-04-28 23:31:06 +00:00
There is a realm cache that holds information about secured applications, general security data, and configuration options.
2016-12-05 16:10:27 +00:00
There is also a user cache that contains user metadata. Both caches default to a maximum of 10000 entries and use a least recently used eviction strategy.
Each of them is also tied to an object revisions cache that controls eviction in a clustered setup.
This cache is created implicitely and has twice the configured size.
2016-04-29 20:12:12 +00:00
There are also separate caches for user sessions, offline tokens, and login failures. These caches are unbounded in size as well.
2016-04-28 23:31:06 +00:00
The eviction policy and max entries for these caches can be configured in the _standalone.xml_, _standalone-ha.xml_, or
2017-08-28 12:50:14 +00:00
_domain.xml_ depending on your <<_operating-mode, operating mode>>.
2016-04-28 23:31:06 +00:00
.non-clustered
[source,xml]
----
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
2016-11-25 21:02:12 +00:00
<cache-container name="keycloak" jndi-name="infinispan/Keycloak">
2016-12-05 16:10:27 +00:00
<local-cache name="realms">
<eviction max-entries="10000" strategy="LRU"/>
</local-cache>
2016-11-25 21:02:12 +00:00
<local-cache name="users">
2016-12-05 16:10:27 +00:00
<eviction max-entries="10000" strategy="LRU"/>
2016-11-25 21:02:12 +00:00
</local-cache>
<local-cache name="sessions"/>
<local-cache name="offlineSessions"/>
<local-cache name="loginFailures"/>
<local-cache name="work"/>
<local-cache name="authorization">
<eviction strategy="LRU" max-entries="100"/>
</local-cache>
<local-cache name="keys">
2016-12-05 16:10:27 +00:00
<eviction strategy="LRU" max-entries="1000"/>
<expiration max-idle="3600000"/>
2016-11-25 21:02:12 +00:00
</local-cache>
</cache-container>
2016-04-28 23:31:06 +00:00
----
2016-04-28 23:34:34 +00:00
.clustered
2016-04-28 23:31:06 +00:00
[source,xml]
----
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
2016-11-25 21:02:12 +00:00
<cache-container name="keycloak" jndi-name="infinispan/Keycloak">
<transport lock-timeout="60000"/>
2016-12-05 16:10:27 +00:00
<local-cache name="realms">
<eviction max-entries="10000" strategy="LRU"/>
</local-cache>
2016-11-25 21:02:12 +00:00
<local-cache name="users">
<eviction max-entries="10000" strategy="LRU"/>
</local-cache>
<distributed-cache name="sessions" mode="SYNC" owners="1"/>
<distributed-cache name="offlineSessions" mode="SYNC" owners="1"/>
<distributed-cache name="loginFailures" mode="SYNC" owners="1"/>
<distributed-cache name="authorization" mode="SYNC" owners="1"/>
<replicated-cache name="work" mode="SYNC"/>
<local-cache name="keys">
<eviction max-entries="1000" strategy="LRU"/>
<expiration max-idle="3600000"/>
</local-cache>
</cache-container>
2016-04-28 23:31:06 +00:00
----
2016-12-05 16:10:27 +00:00
To limit or expand the number of allowed entries simply add or edit the `eviction` element or the `expiration` element of particular cache
configuration.