6.3. Setting the Entry Cache Size

The entry cache is used to store directory entries that are used during search and read operations. Setting the entry cache to a size that enables the Directory Server to store all records has the highest performance impact on search operations.
If entry caching is not configured, Directory Server reads the entry from the id2entry.db database file and converts the DNs from the on-disk format to the in-memory format. Entries that are stored in the cache enable the server to skip the disk I/O and conversion steps.

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 entry cache size, you can use:

Directory Server Console: Setting the Entry Cache Size

For example, to set the entry cache for the cn=userRoot database to 2 GB:
  1. Start the Directory Server Console.
  2. Select the Configuration tab and, in the navigation tree, expand the Data icon.
  3. Expand the suffix associated with the database, such as dc=example,dc=com, and then select the database.
  4. In the Database Settings tab, fill the Memory available for cache field and select the unit. For example:
  5. Click Save.
  6. Restart the Directory Server instance:
    # systemctl restart dirsrv.target

Command Line: Setting the Entry Cache Size

For example, to set the entry cache for the LDBM database to 2 GB:
  1. Set the value in the Directory Server configuration:
    # ldapmodify -D "cn=Directory Manager" -W -x 
    
    dn: cn=database_name,cn=ldbm database,cn=plugins,cn=config
    changetype: modify
    replace: nsslapd-cachememsize
    nsslapd-cachememsize: 2147483648
  2. Restart the Directory Server instance:
    # systemctl restart dirsrv.target