Red Hat Directory Server 7.1 Performance Tuning and Sizing Guidelines

This performance tuning related attribute specifies the cache size in terms of the entries it can hold. However, it is worth noting that it is simpler to limit by memory size only (see nsslapd-cachememsize attribute). If you attempt to set a value that is not a number or is too big for a 32-bit signed integer you will receive an LDAP_UNWILLING_TO_PERFORM error message with additional error information explaining the problem.

Entry DN:

cn=Netscaperoot,cn=ldbm database,cn=plugins,cn=config

Valid Range:

or cn=UserRoot,cn=ldbm database,cn=plugins,cn=config

1 to 2,147,483,647 (or -1 which means limitless) entries

Default Value:

-1

Syntax:

Integer

Example:

nsslapd-cachesize: -1

When the server receives a search request, it will add entries to the entry cache. These two attributes control how big the entry cache can grow. nsslapd-cachesizespecifies how many entries can be cached in the entry cache. nsslapd-cachememsizespecifies the total memory space the entry cache may consume. When the server reaches the limit specified by either cachesize or cachememsize, whichever comes first, it will remove the least recently used entries from the entry cache to make room for new entries. For optimum search performance, all directory entries should be held in the entry cache.

Tuning nsslapd-cachememsize(assume nsslapd-cachesizeis set to –1) is very straightforward:

Step 1: set nsslapd-cachememsizeto some guessed value.

Step 2: prime the server by executing ldapsearch command 1.

Step 3: execute an ldapsearch command (label it as command 3) to find out some entrycache related attributes:

#./ldapsearch –p PORT –b “cn=monitor,cn=DATABASE_ROOT,cn=ldbm database, cn=plugins, cn=config” –D “cn=directory manager” –w PASSWORD “objectclass=*” grep entrycache

entrycachehits: 7

entrycachetries: 1000015

entrycachehitratio: 0

currententrycachesize: 1073739367

maxentrycachesize: 1073741823

currententrycachecount: 398030

maxentrycachecount: -1

Step 4: If the currententrycachecount is less than total number of entries in your database, and the maxentrycachesize hasn’t reached the maximum value that is available from your system

yet, increase nsslapd-cacchememsize, and repeat from Step2 until either all the entries are cached or nsslapd-cachememsizehas reached the maximum value from your system. If nsslapd-cachememsizehasn’t reached the maximum system value when all the entries are cached, then set nsslapd-cachememsizeto be what you got for currententrycachesize from step 3. Allow some safety margin if possible.

To estimate nsslapd-cachememsizefor your database, you can use the following equation derived based on the performance testing. Please note that even though it turns out to be very accurate when tuning cachememsize for different size of databases in the performance test, you should always test it out before going in to production.

Equation 2: Estimate Size of Entry Cache from Performance Testing:

Entrycache = total_number_of_entries_in_the_database * average_space_each_entry_needs_in_the_entrycache.

Page 9