How to configure Openfire's caches

Version 5

    Openfire uses caches to improve performance. Caches can be configured to hold more or less objects in memory and also the amount of time an object will be kept in memory. Big caches can improve performance but very big caches may decrease it since more memory will be used and Java may have to work hard to make room for other objects in memory. In summary, the proper size of the cache should be estimated for each installation based on the number of concurrent users, the roster size, vCard size, number of groups, etc.

     

    Openfire does not provide the option to configure cache properties from the admin console in an easy way. For now you have to create new system properties in the admin console and set the required value. After changing a cache property you will need to restart the server so that the change is actually used.

     

    These are the names of the properties that you can define and configure. The *.size properties define the max size in bytes the cache may be. The *.maxLifetime defines the default max lifetime of the cache, in milliseconds.?

    More caches are defined in http://www.igniterealtime.org/fisheye/browse/svn-org/openfire/trunk/src/java/org /jivesoftware/util/cache/CacheFactory.java?r=trunk

     

    CacheSizeExpiration
    vCardcache.vcardCache.sizecache.vcardCache.maxLifetime
    Usercache.userCache.sizecache.userCache.maxLifetime
    Existence of remote userscache.remoteUsersCache.sizecache.remoteUsersCache.maxLifetime
    Rostercache.username2roster.sizecache.username2roster.maxLifetime
    Groupcache.group.sizecache.group.maxLifetime
    Group Userscache.userGroup.sizecache.userGroup.maxLifetime
    Privacy Listcache.listsCache.sizecache.listsCache.maxLifetime
    Support of XEP-133 by remote serverscache.multicast.sizecache.multicast.maxLifetime
    Offline Messagecache.offlinemessage.sizecache.offlinemessage.maxLifetime
    POP3 auth userscache.pop3.sizecache.pop3.maxLifetime
    File Transfercache.fileTransfer.sizecache.fileTransfer.maxLifetime
    LDAPcache.ldap.sizecache.ldap.maxLifetime

     

    Some values are set in http://fisheye.igniterealtime.org/browse/openfire/trunk/src/java/org/jivesoftwar e/util/cache/DefaultLocalCacheStrategy.java?hb=true

     

    The information below contains the settings for Openfire 3.7.1.

     

    Default values for size is 256 KB and lifetime 6 hours.

     

    cache.fileTransfer.size128 * 1024
    cache.fileTransfer.maxLifetime1000 * 60 * 10
    cache.multicast.size128 * 1024
    cache.multicast.maxLifetimeJiveConstants.DAY
    cache.offlinemessage.size100 * 1024
    cache.offlinemessage.maxLifetimeJiveConstants.HOUR * 12
    cache.pop3.size512 * 1024
    cache.pop3.maxLifetimeJiveConstants.HOUR
    cache.transferProxy.size-1
    cache.transferProxy.maxLifetime1000 * 60 * 10
    cache.group.size1024 * 1024
    cache.group.maxLifetimeJiveConstants.MINUTE *  15
    cache.groupMeta.size512 * 1024
    cache.groupMeta.maxLifetimeJiveConstants.MINUTE *  15
    cache.javascript.size128 * 1024
    cache.javascript.maxLifetime3600 * 24 * 10
    cache.ldap.size512 * 1024
    cache.ldap.maxLifetimeJiveConstants.HOUR * 2
    cache.listsCache.size512 * 1024
    cache.offlinePresence.size512 * 1024
    cache.lastActivity.size128 * 1024
    cache.userCache.size512 * 1024
    cache.userCache.maxLifetimeJiveConstants.MINUTE *  30
    cache.remoteUsersCache.size512 * 1024
    cache.remoteUsersCache.maxLifetimeJiveConstants.MINUTE *  30
    cache.vcardCache.size512 * 1024
    cache.faviconHits.size128 * 1024
    cache.faviconMisses.size128 * 1024
    cache.routeServer.size-1
    cache.routeServer.maxLifetime-1
    cache.routeComponent.size-1
    cache.routeComponent.maxLifetime-1
    cache.routeUser.size-1
    cache.routeUser.maxLifetime-1
    cache.routeAnonymousUser.size-1
    cache.routeAnonymousUser.maxLifetime-1
    cache.routeUserSessions.size-1
    cache.routeUserSessions.maxLifetime-1
    cache.componentsSessions.size-1
    cache.componentsSessions.maxLifetime-1
    cache.connManagerSessions.size-1
    cache.connManagerSessions.maxLifetime-1
    cache.incServerSessions.size-1
    cache.incServerSessions.maxLifetime-1
    cache.sessionsHostname.size-1
    cache.sessionsHostname.maxLifetime-1
    cache.secretKeys.size-1
    cache.secretKeys.maxLifetime-1
    cache.validatedDomains.size-1
    cache.validatedDomains.maxLifetime-1
    cache.directedPresences.size-1
    cache.directedPresences.maxLifetime-1
    cache.serverFeatures.size-1
    cache.serverFeatures.maxLifetime-1
    cache.serverItems.size-1
    cache.serverItems.maxLifetime-1
    cache.serversConfigurations.size128 * 1024
    cache.serversConfigurations.maxLifetimeJiveConstants.MINUTE *  30