Configuring the caching of your LDAP repository

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

The instructions on this page describe how to configure the caching of your LDAP repository.

If you have caching turned on Bamboo will, by default, set the cache to eternal (elements will never expire), and set the maximum number of elements stored to 500. These can be configured to speed up user retrieval, reduce memory usage or reduce the load on the LDAP repository.

On this page:

Controlling the caching of users

By default, caching is activated for your LDAP users. We recommend that you do not disable caching of your LDAP users, as your LDAP repository may be overloaded by the high volume of requests by Bamboo.

To control the caching of users:

  1. <bamboo-home>/xml-data/configuration/atlassian-user.xml ファイルを編集します。
  2. To disable caching, set the property cache="false"on your LDAP repository, as shown in the example below:

    <ldap key="myLdapRepository" name="LDAP Repository@hecate.atlassian.com" cache="false">
              <host>hecate.atlassian.com</host>
              <port>389</port>
  3. To enable caching, set the property cache="true"on your LDAP repository as shown in the example below:

    <ldap key="myLdapRepository" name="LDAP Repository@hecate.atlassian.com" cache="true">
              <host>hecate.atlassian.com</host>
              <port>389</port>

Configuring the LDAP caches

Bamboo uses a number of caches for managing an LDAP repository, each of which can be configured differently. You must enable caching, as described above, before configuring the caches. The caches used by Bamboo are:

Each cache can be configured by following the instructions below:
To configure a cache:

  1. Edit the <bamboo-install>/atlassian-bamboo/WEB-INF/classes/ehcache.xml file.
  2. Find the cache that you wish to edit. Examples of each of the caches are described in the Configuring Caches for Users and Configuring Caches for User Groups sections below.
  3. Modify the cache, as desired. The following properties can be configured for each cache:
  • maxElementsInMemory (mandatory) - Sets the maximum number of objects that will be created in memory
  • eternal (mandatory) - Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired.
  • timeToIdleSeconds (optional) - Sets the time to idle for an element before it expires. i.e. The maximum amount of time between accesses before an element expires. This is only used if the element is not eternal. A value of 0 means that an Element can idle for infinity. The default value is 0.
  • timeToLiveSeconds (optional) - Sets the time to live for an element before it expires i.e. The maximum time between creation time and when an element expires. This is only used if the element is not eternal. A value of 0 means that an Element can live for infinity. The default value is 0.

Configuring caches for users

(warning) In each of the examples below, replace myLdapRepository with the key of the repository specified in atlassian-user.xml

  • LDAPUserManagerReadOnly.*.users

    LDAPUserManagerReadOnly.*.users stores the individual users, if you have difficulties with Bamboo picking up new user additions in the LDAP repository you will need to alter the configuration of this cache. In the example below, the users will expire after 5 minutes.

    <cache name="com.atlassian.user.impl.ldap.LDAPUserManagerReadOnly.myLdapRepository.users"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    
  • LDAPUserManagerReadOnly.*.users_ro

    LDAPUserManagerReadOnly.*.users_ro stores whether or not the users are read only. This will have no effect on the functionality of Bamboo, but you may wish to modify this cache for performance and memory tuning purposes.

    <cache name="com.atlassian.user.impl.ldap.LDAPUserManagerReadOnly.myLdapRepository.users_ro"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    
  • LDAPUserManagerReadOnly.*.repository

    LDAPUserManagerReadOnly.*.repository stores which repository the user belongs to. Bamboo does not yet support multiple repositories, so modifying this cache will have no effect on functionality. However, you may wish to modify this cache for performance and memory tuning purposes.

    <cache name="com.atlassian.user.impl.ldap.LDAPUserManagerReadOnly.myLdapRepository.repository"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    

Configuring caches for groups

(warning) In each of the examples below, replace myLdapRepository with the key of the repository specified in atlassian-user.xml

  • LDAPGroupManagerReadOnly.*.groups

    LDAPGroupManagerReadOnly.*.groups stores the available groups in LDAP. If you wish Bamboo to pick up changes made to groups, then you will need to configure this cache appropriately.

    <cache name="com.atlassian.user.impl.ldap.LDAPGroupManagerReadOnly.myLdapRepository.groups"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    
  • LDAPGroupManagerReadOnly.*.groups_hasMembership* and *LDAPGroupManagerReadOnly.*.groups_getGroupsForUser

    The LDAPGroupManagerReadOnly.*.groups_hasMembership and LDAPGroupManagerReadOnly.*.groups_getGroupsForUser caches store the associations between users and groups. If you wish Bamboo to pick up changes made to group memberships then you will need to configure these caches appropriately.

    <cache name="com.atlassian.user.impl.ldap.LDAPGroupManagerReadOnly.myLdapRepository.groups_hasMembership"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    <cache name="com.atlassian.user.impl.ldap.LDAPGroupManagerReadOnly.myLdapRepository.groups_getGroupsForUser"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    
  • LDAPGroupManagerReadOnly.*.repositories

    LDAPGroupManagerReadOnly.*.repositories stores which repository the group belongs to. Bamboo does not yet support multiple repositories, so modifying this cache will have no effect on functionality. However, you may wish to modify this cache for performance and memory tuning purposes.

    <cache name="com.atlassian.user.impl.ldap.LDAPGroupManagerReadOnly.myLdapRepository.repositories"
             maxElementsInMemory="500"
             eternal="false"
             timeToIdleSeconds="300"
             timeToLiveSeconds="300"
       />
    
Last modified on Mar 21, 2018

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.