blob: f173899f6f21b27b18df5c46ebe244b0a1e07f18 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<config xmlns="http://www.ehcache.org/v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.6.xsd">
<!--
Cache configuration
===================
The following attributes are required.
name:
Sets the name of the cache. This is used to identify the cache. It must be unique.
maxElementsInMemory:
Sets the maximum number of objects that will be created in memory
maxElementsOnDisk:
Sets the maximum number of objects that will be maintained in the DiskStore
The default value is zero, meaning unlimited.
eternal:
Sets whether elements are eternal. If eternal, timeouts are ignored and the
element is never expired.
overflowToDisk:
Sets whether elements can overflow to disk when the memory store
has reached the maxInMemory limit.
The following attributes and elements are optional.
timeToIdleSeconds:
Sets the time to idle for an element before it expires.
i.e. The maximum amount of time between accesses before an element expires
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that an Element can idle for infinity.
The default value is 0.
timeToLiveSeconds:
Sets the time to live for an element before it expires.
i.e. The maximum time between creation time and when an element expires.
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that and Element can live for infinity.
The default value is 0.
diskPersistent:
Whether the disk store persists between restarts of the Virtual Machine.
The default value is false.
diskExpiryThreadIntervalSeconds:
The number of seconds between runs of the disk expiry thread. The default value
is 120 seconds.
diskSpoolBufferSizeMB:
This is the size to allocate the DiskStore for a spool buffer. Writes are made
to this area and then asynchronously written to disk. The default size is 30MB.
Each spool buffer is used only by its cache. If you get OutOfMemory errors consider
lowering this value. To improve DiskStore performance consider increasing it. Trace level
logging in the DiskStore will show if put back ups are occurring.
clearOnFlush:
whether the MemoryStore should be cleared when flush() is called on the cache.
By default, this is true i.e. the MemoryStore is cleared.
memoryStoreEvictionPolicy:
Policy would be enforced upon reaching the maxElementsInMemory limit. Default
policy is Least Recently Used (specified as LRU). Other policies available -
First In First Out (specified as FIFO) and Less Frequently Used
(specified as LFU)
-->
<!-- Sample cache named sampleCache1 This cache contains a maximum in memory
of 10000 elements, and will expire an element if it is idle for more than
5 minutes and lives for more than 10 minutes. If there are more than 10000
elements it will overflow to the disk cache, which in this configuration
will go to wherever java.io.tmp is defined on your system. On a standard
Linux system this will be /tmp" -->
<!--
Note: set the 'overflowToDisk' flag always to 'true'.
The groups information is only read once during startup hence
we need to retain this info forever available in the cache
as long as the server is running, so hinting the cache to store
on disk is needed to swap the data if it is too much to hold in memory -->
<cache alias="groupCache">
<key-type>java.lang.String</key-type>
<value-type>java.util.Set</value-type>
<expiry>
<ttl unit="seconds">1200</ttl>
</expiry>
<heap>10000</heap>
<heap-store-settings>
<max-object-size>10000</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="true"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
memoryStoreEvictionPolicy="LFU"
diskPersistent="false" />
-->
</cache>
<cache alias="dnCache">
<key-type>java.lang.String</key-type>
<value-type>org.apache.directory.api.ldap.model.name.Dn</value-type>
<expiry>
<ttl unit="seconds">600</ttl>
</expiry>
<heap>10000</heap>
<heap-store-settings>
<max-object-size>10000</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="false"
overflowToDisk="false"
diskSpoolBufferSizeMB="20"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
diskPersistent="false" />
-->
</cache>
<!-- Kerberos replay cache
NOTE1: keep the maxElementsInMemory as low as possible to avoid wasting memory
Cause the elements present in the cache won't be removed dynamically even after their TTL
expires. For a good explanation see http://forums.terracotta.org/forums/posts/list/4126.page
NOTE2: We don't use the standard eviction policies like LFU or LRU rather we use a custom eviction
policy based on the value of clockskew setting. The default value of clokcskew is 5 minutes,
which is also set for the TTL and TTI values of cache config
So what we do here is enable the overflowToDisk flag and then let the disk store be cleaned
periodically based on diskExpiryThreadIntervalSeconds
-->
<cache alias="kdcReplayCache">
<key-type>java.lang.String</key-type>
<expiry>
<ttl unit="seconds">600</ttl>
</expiry>
<heap>100</heap>
<heap-store-settings>
<max-object-size>100</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="false"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
diskExpiryThreadIntervalSeconds="300"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
diskPersistent="false" />
-->
</cache>
<!-- ChangePassword replay cache, this has the same settings as the Kerberos replay cache -->
<cache alias="changePwdReplayCache">
<key-type>java.lang.String</key-type>
<expiry>
<ttl unit="seconds">600</ttl>
</expiry>
<heap>100</heap>
<heap-store-settings>
<max-object-size>100</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="false"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
diskExpiryThreadIntervalSeconds="300"
timeToLiveSeconds="300"
timeToIdleSeconds="300"
diskPersistent="false" />
-->
</cache>
<!-- partition caches
the name format:
name="{partition-suffix}" for partition
name="{partition-suffix}:{index name/OID}" for each partition's index (currently only RDN index supports cache)
-->
<cache alias="ou=system">
<key-type>java.lang.String</key-type>
<expiry>
<ttl unit="seconds">600</ttl>
</expiry>
<heap>1000</heap>
<heap-store-settings>
<max-object-size>1000</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="false"
overflowToDisk="true"
diskSpoolBufferSizeMB="20"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
diskPersistent="false"/>
-->
</cache>
<cache alias="ou=system:apacheRdn">
<key-type>java.lang.String</key-type>
<expiry>
<ttl unit="seconds">600</ttl>
</expiry>
<heap>10000</heap>
<heap-store-settings>
<max-object-size>10000</max-object-size>
</heap-store-settings>
<!-- unmigrated 2.x settings
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
diskPersistent="false"/>
-->
</cache>
<cache alias="alias">
<key-type>java.lang.String</key-type>
<value-type>org.apache.directory.api.ldap.model.name.Dn</value-type>
<expiry>
<ttl unit="seconds">1200</ttl>
</expiry>
<heap>1000</heap>
<heap-store-settings>
<max-object-size>1000</max-object-size>
</heap-store-settings>
</cache>
<cache alias="entryDn">
<key-type>java.lang.String</key-type>
<value-type>org.apache.directory.api.ldap.model.name.Dn</value-type>
<expiry>
<ttl unit="seconds">1200</ttl>
</expiry>
<heap>1000</heap>
<heap-store-settings>
<max-object-size>1000</max-object-size>
</heap-store-settings>
</cache>
</config>