hazelcast-cache-config.xml 18.8 KB
Newer Older
1 2
<?xml version="1.0" encoding="UTF-8"?>
<!--
3
  ~ Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
4 5 6 7 8 9 10 11 12 13 14 15 16 17
  ~
  ~ Licensed 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.
  -->

18
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.5.xsd"
19 20 21 22 23 24
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <group>
        <name>openfire</name>
        <password>openfire</password>
    </group>
25 26
    <properties>
      <property name="hazelcast.logging.type">slf4j</property>
27 28 29
      <property name="hazelcast.operation.call.timeout.millis">30000</property>
      <property name="hazelcast.memcache.enabled">false</property>
      <property name="hazelcast.rest.enabled">false</property>
30
    </properties>
31 32
    <management-center enabled="false"/>
    <network>
33 34 35 36
        <port auto-increment="true" port-count="100">5701</port>
        <outbound-ports>
            <ports>0</ports>
        </outbound-ports>
37 38 39 40 41 42 43 44
        <join>
            <multicast enabled="true">
                <multicast-group>224.2.2.3</multicast-group>
                <multicast-port>54327</multicast-port>
            </multicast>
            <tcp-ip enabled="false"/>
            <aws enabled="false"/>
        </join>
45 46 47 48 49
        <interfaces enabled="false">
            <interface>10.10.1.*</interface>
        </interfaces>
        <ssl enabled="false"/>
        <socket-interceptor enabled="false"/>
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
        <symmetric-encryption enabled="false">
            <!--
               encryption algorithm such as
               DES/ECB/PKCS5Padding,
               PBEWithMD5AndDES,
               AES/CBC/PKCS5Padding,
               Blowfish,
               DESede
            -->
            <algorithm>PBEWithMD5AndDES</algorithm>
            <!-- salt value to use when generating the secret key -->
            <salt>thesalt</salt>
            <!-- pass phrase to use when generating the secret key -->
            <password>thepass</password>
            <!-- iteration count to use when generating the secret key -->
            <iteration-count>19</iteration-count>
        </symmetric-encryption>
67 68
    </network>
    <partition-group enabled="false"/>
69 70 71 72 73
    <executor-service name="default">
        <pool-size>16</pool-size>
        <!--Queue capacity. 0 means Integer.MAX_VALUE.-->
        <queue-capacity>0</queue-capacity>
    </executor-service>
74 75 76 77 78 79 80 81
    <queue name="default">
        <!--
            Maximum size of the queue. When a JVM's local queue size reaches the maximum,
            all put/offer operations will get blocked until the queue size
            of the JVM goes down below the maximum.
            Any integer between 0 and Integer.MAX_VALUE. 0 means
            Integer.MAX_VALUE. Default is 0.
        -->
82 83 84 85 86 87 88 89 90 91 92 93 94 95
        <max-size>0</max-size>
        <!--
            Number of backups. If 1 is set as the backup-count for example,
            then all entries of the map will be copied to another JVM for
            fail-safety. 0 means no backup.
        -->
        <backup-count>1</backup-count>

        <!--
            Number of async backups. 0 means no backup.
        -->
        <async-backup-count>0</async-backup-count>

        <empty-queue-ttl>-1</empty-queue-ttl>
96 97 98 99 100
    </queue>
    <!--
    	Default Hazelcast cache configuration for Openfire. 
    -->
    <map name="default">
101 102 103 104 105 106 107 108 109
        <!--
           Data type that will be used for storing recordMap.
           Possible values:
           BINARY (default): keys and values will be stored as binary data
           OBJECT : values will be stored in their object forms
           NATIVE : values will be stored in non-heap region of JVM
        -->
        <in-memory-format>BINARY</in-memory-format>

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
        <!--
            Number of backups. If 1 is set as the backup-count for example,
            then all entries of the map will be copied to another JVM for
            fail-safety. 0 means no backup.
        -->
        <backup-count>1</backup-count>
        <!--
            Number of async backups. 0 means no backup.
        -->
        <async-backup-count>0</async-backup-count>
        <!--
            Can we read the local backup entries? Default value is false for
            strong consistency. Being able to read backup data will give you
            greater performance.
        -->
        <read-backup-data>true</read-backup-data>
        <!--
			Maximum number of seconds for each entry to stay in the map. Entries that are
			older than <time-to-live-seconds> and not updated for <time-to-live-seconds>
			will get automatically evicted from the map.
			Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
		-->
        <time-to-live-seconds>0</time-to-live-seconds>
        <!--
			Maximum number of seconds for each entry to stay idle in the map. Entries that are
			idle(not touched) for more than <max-idle-seconds> will get
			automatically evicted from the map. Entry is touched if get, put or containsKey is called.
			Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
		-->
        <max-idle-seconds>0</max-idle-seconds>
        <!--
            Valid values are:
            NONE (no eviction),
            LRU (Least Recently Used),
            LFU (Least Frequently Used).
            NONE is the default.
        -->
        <eviction-policy>LRU</eviction-policy>
        <!--
            Maximum size of the map. When max size is reached,
            map is evicted based on the policy defined.
            Any integer between 0 and Integer.MAX_VALUE. 0 means
            Integer.MAX_VALUE. Default is 0.
        -->
154
        <max-size policy="PER_NODE">100000</max-size>
155 156 157 158 159 160 161
        <!--
            When max. size is reached, specified percentage of
            the map will be evicted. Any integer between 0 and 100.
            If 25 is set for example, 25% of the entries will
            get evicted.
        -->
        <eviction-percentage>25</eviction-percentage>
162 163 164 165 166 167
        <!--
            Minimum time in milliseconds which should pass before checking
            if a partition of this map is evictable or not.
            Default value is 100 millis.
        -->
        <min-eviction-check-millis>100</min-eviction-check-millis>
168 169 170 171 172 173 174
        <!--
            While recovering from split-brain (network partitioning),
            map entries in the small cluster will merge into the bigger cluster
            based on the policy set here. When an entry merge into the
            cluster, there might an existing entry with the same key already.
            Values of these entries might be different for that same key.
            Which value should be set for the key? Conflict is resolved by
175
            the policy set here. Default policy is PutIfAbsentMapMergePolicy
176 177

            There are built-in merge policies such as
178 179 180 181
            com.hazelcast.map.merge.PassThroughMergePolicy; entry will be added if there is no existing entry for the key.
            com.hazelcast.map.merge.PutIfAbsentMapMergePolicy ; entry will be added if the merging entry doesn't exist in the cluster.
            com.hazelcast.map.merge.HigherHitsMapMergePolicy ; entry with the higher hits wins.
            com.hazelcast.map.merge.LatestUpdateMapMergePolicy ; entry with the latest update wins.
182
        -->
183
        <merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
		<!--
			Near cache provides a local view of the clustered map, which is
			ideal for high-read caches. Each cluster member retains a local
			copy of entries retrieved from the distributed map. This reduces 
			network load for caches that require frequent reads. However, if 
			the	entries are updated frequently, there can be a performance 
			penalty due to invalidations on the other cluster members.
		-->
        <near-cache>
            <max-size>1000</max-size>
            <time-to-live-seconds>0</time-to-live-seconds>
            <max-idle-seconds>600</max-idle-seconds>
            <eviction-policy>LRU</eviction-policy>
            <invalidate-on-change>true</invalidate-on-change>
        </near-cache>
    </map>
    
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
    <multimap name="default">
        <backup-count>1</backup-count>
        <value-collection-type>SET</value-collection-type>
    </multimap>

    <list name="default">
        <backup-count>1</backup-count>
    </list>

    <set name="default">
        <backup-count>1</backup-count>
    </set>

    <jobtracker name="default">
        <max-thread-size>0</max-thread-size>
        <!-- Queue size 0 means number of partitions * 2 -->
        <queue-size>0</queue-size>
        <retry-count>0</retry-count>
        <chunk-size>1000</chunk-size>
        <communicate-stats>true</communicate-stats>
        <topology-changed-strategy>CANCEL_RUNNING_OPERATION</topology-changed-strategy>
    </jobtracker>

    <semaphore name="default">
        <initial-permits>0</initial-permits>
        <backup-count>1</backup-count>
        <async-backup-count>0</async-backup-count>
    </semaphore>

230 231 232 233 234 235 236 237 238 239 240 241 242 243
    <reliable-topic name="default">
        <read-batch-size>10</read-batch-size>
        <topic-overload-policy>BLOCK</topic-overload-policy>
        <statistics-enabled>true</statistics-enabled>
    </reliable-topic>
    
    <ringbuffer name="default">
        <capacity>10000</capacity>
        <backup-count>1</backup-count>
        <async-backup-count>0</async-backup-count>
        <time-to-live-seconds>30</time-to-live-seconds>
        <in-memory-format>BINARY</in-memory-format>
    </ringbuffer>

244 245 246 247 248 249
    <serialization>
        <portable-version>0</portable-version>
    </serialization>

    <services enable-defaults="true"/>

250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
    <!--  Partitioned Openfire caches without size/time limits (no eviction). -->
    
    <map name="opt-$cacheStats">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Client Session Info Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Components Sessions">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Connection Managers Sessions">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Secret Keys Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Validated Domains">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Disco Server Features">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Disco Server Items">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Incoming Server Sessions">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Sessions by Hostname">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Routing User Sessions">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Routing Components Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Routing Users Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Routing AnonymousUsers Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Routing Servers Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    <map name="Directed Presences">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
    </map>
    
    <!-- Caches with size and/or time limits (TTL) -->
    
    <map name="POP3 Authentication">
        <backup-count>1</backup-count>
321
        <max-size policy="PER_NODE">10000</max-size>
322 323 324 325 326
        <time-to-live-seconds>3600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="LDAP Authentication">
        <backup-count>1</backup-count>
327
        <max-size policy="PER_NODE">10000</max-size>
328 329 330 331 332 333 334 335 336 337
        <time-to-live-seconds>7200</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="File Transfer">
        <backup-count>1</backup-count>
        <time-to-live-seconds>600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="File Transfer Cache">
        <backup-count>1</backup-count>
338
        <max-size policy="PER_NODE">10000</max-size>
339 340 341 342 343
        <time-to-live-seconds>600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Javascript Cache">
        <backup-count>1</backup-count>
344
        <max-size policy="PER_NODE">10000</max-size>
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
        <time-to-live-seconds>864000</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Entity Capabilities">
        <backup-count>1</backup-count>
        <time-to-live-seconds>172800</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Entity Capabilities Users">
        <backup-count>1</backup-count>
        <time-to-live-seconds>172800</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Favicon Hits">
        <backup-count>1</backup-count>
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Favicon Misses">
        <backup-count>1</backup-count>
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Last Activity Cache">
        <backup-count>1</backup-count>
370
        <max-size policy="PER_NODE">10000</max-size>
371 372 373 374 375 376 377 378 379 380
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Locked Out Accounts">
        <backup-count>1</backup-count>
        <time-to-live-seconds>900</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Multicast Service">
        <backup-count>1</backup-count>
381
        <max-size policy="PER_NODE">10000</max-size>
382 383 384 385 386
        <time-to-live-seconds>86400</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Offline Message Size">
        <backup-count>1</backup-count>
387
        <max-size policy="PER_NODE">100000</max-size>
388 389 390 391 392
        <time-to-live-seconds>43200</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Offline Presence Cache">
        <backup-count>1</backup-count>
393
        <max-size policy="PER_NODE">100000</max-size>
394 395 396 397 398
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Privacy Lists">
        <backup-count>1</backup-count>
399
        <max-size policy="PER_NODE">100000</max-size>
400 401 402 403 404
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Remote Users Existence">
        <backup-count>1</backup-count>
405
        <max-size policy="PER_NODE">100000</max-size>
406 407 408 409 410
        <time-to-live-seconds>600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Remote Server Configurations">
        <backup-count>1</backup-count>
411
        <max-size policy="PER_NODE">100000</max-size>
412 413 414 415 416 417 418 419 420
        <time-to-live-seconds>1800</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    
    <!-- These caches have size and/or time limits (idle) -->
    
    <map name="Group Metadata Cache">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
421
        <max-size policy="PER_NODE">100000</max-size>
422 423 424 425 426 427
        <max-idle-seconds>3600</max-idle-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Group">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
428
        <max-size policy="PER_NODE">100000</max-size>
429 430 431 432 433 434
        <max-idle-seconds>3600</max-idle-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="Roster">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
435
        <max-size policy="PER_NODE">100000</max-size>
436 437 438 439 440 441
        <max-idle-seconds>3600</max-idle-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    <map name="User">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
442
        <max-size policy="PER_NODE">100000</max-size>
443 444 445 446 447 448 449 450 451
        <max-idle-seconds>3600</max-idle-seconds>
        <eviction-policy>LRU</eviction-policy>
    </map>
    
    <!-- These caches use a near-cache to improve read performance -->
    
    <map name="VCard">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
452
        <max-size policy="PER_NODE">100000</max-size>
453 454 455 456 457 458 459 460 461 462 463 464
        <time-to-live-seconds>21600</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
        <near-cache>
            <max-size>10000</max-size>
            <max-idle-seconds>1800</max-idle-seconds>
            <eviction-policy>LRU</eviction-policy>
            <invalidate-on-change>true</invalidate-on-change>
        </near-cache>
    </map>
    <map name="Published Items">
        <backup-count>1</backup-count>
        <read-backup-data>true</read-backup-data>
465
        <max-size policy="PER_NODE">100000</max-size>
466 467 468 469 470 471 472 473 474 475 476
        <time-to-live-seconds>900</time-to-live-seconds>
        <eviction-policy>LRU</eviction-policy>
        <near-cache>
            <max-size>10000</max-size>
            <max-idle-seconds>60</max-idle-seconds>
            <eviction-policy>LRU</eviction-policy>
            <invalidate-on-change>true</invalidate-on-change>
        </near-cache>
    </map>

</hazelcast>