Ce contenu n'est pas disponible dans la langue sélectionnée.

6.5. Setting the Database Cache Size


The database cache contains the Berkeley database index files for the database, meaning all of the *.db and other files used for attribute indexing by the database. This value is passed to the Berkeley DB API function set_cachesize().
This cache size has less of an impact on Directory Server performance than the entry cache size, but if there is available RAM after the entry cache size is set, increase the amount of memory allocated to the database cache.
The operating system also has a file system cache which may compete with the database cache for RAM usage. Refer to the operating system documentation to find information on file system cache settings and monitoring the file system cache.

Note

Instead of manually setting the entry cache size Red Hat recommends the auto-sizing feature for optimized settings based on the hardware resources. For details, see Section 6.1.1, “Manually Re-enabling the Database and Entry Cache Auto-sizing”.
To manually set the database cache size using the command line:
  1. Disable automatic cache tuning:
    # dsconf -D "cn=Directory Manager" ldap://server.example.com backend config set --cache-autosize=0
    Copy to Clipboard Toggle word wrap
    Manually set the database cache size:
    # dsconf -D "cn=Directory Manager" ldap://server.example.com backend config set --dbcachesize=268435456
    Copy to Clipboard Toggle word wrap
    This command sets the database cache to 256 megabytes.
  2. Restart the Directory Service instance:
    # dsctl instance_name restart
    Copy to Clipboard Toggle word wrap
To manually set the database cache size using the Web Console:
  1. Open the Directory Server user interface in the web console. For details, see Logging Into Directory Server Using the Web Console section in the Red Hat Directory Server Administration Guide.
  2. Select the instance.
  3. On the Database tab, select Global Database Configuration.
  4. Disable Automatic Cache Tuning.
  5. Click Save Configuration.
  6. Set the Database Cache Size (bytes) field to the database cache size.
  7. Click Save Configuration.
  8. Click the Actions button, and select Restart Instance.

6.5.3. Storing the Database Cache on a RAM Disk

If your system running the Directory Server instance has enough free RAM, you can optionally store the database cache on a RAM disk for further performance improvements:
  1. Create a directory for the database cache and metadata on the RAM disk:
    # mkdir -p /dev/shm/slapd-instance_name/
    Copy to Clipboard Toggle word wrap
  2. Set the following permissions on the directory:
    # chown dirsrv:dirsrv /dev/shm/slapd-instance_name/
    # chmod 770 /dev/shm/slapd-instance_name/
    Copy to Clipboard Toggle word wrap
  3. Stop the Directory Server instance:
    # systemctl stop dirsrv@instance_name
    Copy to Clipboard Toggle word wrap
  4. Edit the /etc/dirsrv/slapd-instance_name/dse.ldif file and set the new path in the nsslapd-db-home-directory attribute in the cn=bdb,cn=config,cn=ldbm database,cn=plugins,cn=config entry:
    dn: cn=bdb,cn=config,cn=ldbm database,cn=plugins,cn=config
    ...
    nsslapd-db-home-directory: /dev/shm/slapd-instance_name/
    Copy to Clipboard Toggle word wrap
    If the nsslapd-db-home-directory attribute does not exist, add it with the new value to the cn=bdb,cn=config,cn=ldbm database,cn=plugins,cn=config entry.
  5. Start the Directory Server instance:
    # systemctl start dirsrv@instance_name
    Copy to Clipboard Toggle word wrap

Note

When the database cache is stored on a RAM disk, Directory Server needs to recreate it after each reboot. As a consequence, the service start and initial operations are slower until the cache is recreated.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat