Service manual
Cache Priming and Monitoring
122 Sun ONE Directory Server Installation and Tuning Guide • June 2003
Cache Priming and Monitoring
Primingcaches means filling them with data such that subsequent Directory Server
behavior reflects normal operational performance, rather than ramp up. Prime
caches before measuring and analyzing potential optimizations.
Prime the entry cache for the suffix using the
ldapsearch utility. For example:
$ ldapsearch -D directoryManager -w password -b suffix objectclass=\* > /dev/null
Perform searches to primethe databasecacheand in particular to loadindexes into
thecache. You canprime presence indexes by performingsearcheswith filters such
as
(mail=*). For other indexes, consider using the Sun ONE Directory Server
Resource Kit
searchrate utility applying filter formats to search for all possible
values of each attribute to index. In other words, to check performance for equality
searches against
mail attributes, for example, generate a file with one mail address
per line for each mail address,then use the
searchrate utility to perform searches
using the file. For example:
$ searchrate -b suffix -f "(mail=%s)" -i mail.file -K -t 10
Consider using -K and -t to save time. When used with the -K option, searchrate
holds the connection open, binding only once, not binding for each search. The -t
option lets you specify how many threads to use. Refer to the Sun ONE Directory
Server Resource Kit documentation for details concerning the
searchrate utility.
The Sun ONE Directory Server Resource Kit can be obtained as described in
“Downloading Directory Server Tools,” on page 12.
After other caches are primed, you can prime available file system cache. Although
you cannot guarantee information in the file system cache is not flushed, priming
file system cache nevertheless may improve ramp up time. To prime files system
cache on UNIX systems you may use the
dd(1M) command as super user. On
Solaris systems with database files in the default location for example:
# for db in ServerRoot/slapd-serverID/db/*/*.db3
>do
> dd if=‘pwd‘/$db of=/dev/null bs=512k
>done
0+1 records in
0+1 records out
...
Aftercaches are primed, you may run tests,and monitor whethercachetuning has
produced the desired outcomes. Directory Server Console displays monitoring
information for caches when you select the Suffixes node under the Status tab as
shown in Figure 6-5 on page 119. Alternatively, paging and cache activity can be
monitored by searching from the command line: