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" . 6.5.1. Manually Setting the Database Cache Size Using the Command Line To manually set the database cache size using the command line: Disable automatic cache tuning: Manually set the database cache size: This command sets the database cache to 256 megabytes. Restart the Directory Service instance: 6.5.2. Manually Setting the Database Cache Size Using the Web Console To manually set the database cache size using the Web Console: 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 . Select the instance. On the Database tab, select Global Database Configuration . Disable Automatic Cache Tuning . Click Save Configuration . Set the Database Cache Size (bytes) field to the database cache size. Click Save Configuration . 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: Create a directory for the database cache and metadata on the RAM disk: Set the following permissions on the directory: Stop the Directory Server instance: 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: 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. Start the Directory Server instance: 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.

Commands:
dsconf -D "cn=Directory Manager" ldap://server.example.com backend config set --cache-autosize=0
dsconf -D "cn=Directory Manager" ldap://server.example.com backend config set --dbcachesize=268435456
dsctl instance_name restart
mkdir -p /dev/shm/slapd- instance_name /
chown dirsrv:dirsrv /dev/shm/slapd- instance_name / chmod 770 /dev/shm/slapd- instance_name /
systemctl stop dirsrv@ instance_name
dn: cn=bdb,cn=config,cn=ldbm database,cn=plugins,cn=config nsslapd-db-home-directory: /dev/shm/slapd- instance_name /
systemctl start dirsrv@ instance_name