Measuring cache entry size

Filter cache and entry cache size are measured in numbers of entries. To determine the number of entries to cache in the LDAP caches, you must find how large the entries in the caches are.

About this task

You can calculate the average size of an entry in a sample entry cache, but the average filter cache entry size can be calculated similarly.

Procedure

  1. Log in with the directory server instance owner credentials.
  2. Take the following actions on the LDAP server:
    1. Set the filter cache size to 0.
    2. Set the entry cache size to a small value. For example, 200.
    3. Start the ibmslapd process of an instance.
  3. Take the following actions from the client:
    1. Run your application.
    2. Run the following command to find the entry cache population, population1:
      ldapsearch -h server -p port -s base -b cn=monitor objectclass=* 
      | grep	entry_cache_current
  4. Take the following actions on the LDAP Server:
    1. Run the following command to find the memory that is used by the ibmslapd process, ibmslapd1:
      Platform Run this command:
      AIX® ps -e -o vsz -o command | grep ibmslapd
      Windows™ Task Manage > Virtual Memory size
    2. Stop the ibmslapd process.
    3. Increase the size of the entry cache but keep it smaller than your working set.
    4. Start the ibmslapd process.
  5. Run your application again and find the entry cache population, population2.
    ldapsearch -h server -p port -s base -b cn=monitor objectclass=* 
    | grep	entry_cache_current
  6. Find the memory that is used by the ibmslapd process, ibmslapd2.
  7. Calculate the size of an entry cache entry by using the following formula:
    (ibmslapd size2 - ibmslapd size1)/(entry cache population2 - entry cache population1)

Results

For example, when you use the formula for a 500000 entry database, the following entry size is calculated:

(192084 KB – 51736 KB) / (48485 – 10003) = 3.65 KB per entry