Sun Java System Directory Server Enterprise Edition 6.0 Administration Guide

Configuring Memory

This section provides information about managing different types of memory. For a description of the different types of cache and for information about cache tuning, see Chapter 5, Directory Server Data Caching, in Sun Java System Directory Server Enterprise Edition 6.0 Reference.

Priming Caches

To prime caches means to fill the caches with data so that subsequent Directory Server behavior reflects normal operational performance, rather than ramp-up performance. Priming caches is useful for arriving at reproducible results when benchmarking, and for measuring and analyzing potential optimizations.

If possible, do not actively prime the caches. Let the caches be primed by normal or typical client interaction with Directory Server before you measure performance.

Tools for priming database cache can be found at http://www.slamd.com.

ProcedureTo Modify Database Cache


Caution – Caution –

Modifying cache can severely impact server performance. Use caution when modifying cache.


You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

  1. Obtain the current database cache level.


    $ dsconf get-server-prop -h host -p port db-cache-size
  2. Change the database cache level.


    $ dsconf set-server-prop -h host -p port db-cache-size:sizeM

    where size is the size in megabytes.

ProcedureTo Monitor Database Cache

The default level of cache at installation is suited to a test environment, not a production environment. For tuning purposes, you might want to monitor the database cache for your server.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

    Monitor database cache.


    $ ldapsearch -h host -p port -D cn=admin,cn=Administrators,cn=config -w - \
     -b "cn=monitor,cn=ldbm database,cn=plugins,cn=config" "(objectclass=*)"

    If the database cache size is large enough and it has been primed, the hit ratio (dbcachehitratio) should be high. In addition, the number of pages that are read in (dbcachepagein) and the clean pages that are written out (dbcacheroevict) should be low. Here, “high” and “low” are relative to the deployment constraints.

ProcedureTo Monitor Database Cache

The default level of cache at installation is suited to a test environment, not a production environment. For tuning purposes, you might want to monitor the database cache for your server.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

    Monitor database cache.


    $ ldapsearch -h host -p port -D cn=admin,cn=Administrators,cn=config -w - \
     -b "cn=monitor,cn=ldbm database,cn=plugins,cn=config" "(objectclass=*)"

    If the database cache size is large enough and the entry cache is primed, the hit ratio (dbcachehitratio) should be high. In addition, the number of pages that are read in (dbcachepagein) and the clean pages that are written out (dbcacheroevict) should be low. Here, “high” and “low” are relative to the deployment constraints.

ProcedureTo Monitor Entry Cache

For tuning purposes, you might want to check the entry cache for one or more suffixes. Use this procedure to view the entry cache levels.

You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

    Monitor entry cache.


    $ ldapsearch -h host -p port -D cn=admin,cn=Administrators,cn=config -w - \
     -b "cn=monitor,cn=db-name,cn=ldbm database,cn=plugins,cn=config" "(objectclass=*)"

    If the entry cache for a suffix is large enough to hold most of the entries in the suffix and if the cache is primed, the hit ratio (entrycachehitratio) should be high.

    If you have primed the cache, you will see that as the previously empty entry cache fills, entry cache size (currententrycachesize) approaches the maximum entry cache size (maxentrycachesize). Ideally, the size in entries (currententrycachecount) should be either equal to or very close to the total number of entries in the suffix (ldapentrycachecount).

ProcedureTo Modify Entry Cache


Caution – Caution –

Modifying cache can severely impact server performance. Use caution when modifying cache.


You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.

  1. Obtain the current entry cache level.


    $ dsconf get-suffix-prop -h host -p port suffix-DN entry-cache-count
  2. Change the entry cache level.


    $ dsconf set-suffix-prop -h host -p port suffix-DN entry-cache-count:integer
    

    where integer is the size in entries.

  3. Change the entry cache size.


    $ dsconf set-suffix-prop -h host -p port suffix-DN entry-cache-size:integer
    

    where integer is the size in bits.

ProcedureTo Configure Heap Memory Threshold

If you want to limit the amount of heap memory used by the nsslapd process, you can set threshold values for the dynamic memory footprint. You might set this threshold when Directory Server is running on a machine where resources are shared or sparse.


Note –

This threshold can only be set on SolarisTM and Linux platforms.


For information about memory sizing, see Directory Server and Memory in Sun Java System Directory Server Enterprise Edition 6.0 Deployment Planning Guide.

You cannot use DSCC to perform this task. Use the command line, as described in this procedure.

  1. Set the maximum heap high memory threshold.


    $ dsconf set-server-prop -h host -p port heap-high-threshold-size:value
    

    For recommendations on the values to use for ds-maxheap-high , see the ds-maxheaphigh(5dsconf) man page.

  2. Optionally, set the maximum heap low memory threshold .


    $ dsconf set-server-prop -h host -p port heap-low-threshold-size:value
    

    For recommendations on the values to use for ds-maxheap-low , see the ds-maxheaphigh(5dsconf) man page, which contains recommendations for both ds-maxheap-high and ds-maxheap-low.