6.2. Determining the Required Cache Sizes
dbmon.shscript enables you to monitor cache statistics at runtime and continuously outputs the statistics. To terminate the script, press the Ctrl+C key combination.
dbmon.shrequires you to pass the options as environment variables to the script. For further details see the Directory Server Configuration, Command, and File Reference.
Example 6.2. Using the
BINDDN="cn=Directory Manager" BINDPW=secret SERVID=slapd-instance_name dbmon.shdbcachefree 397310 free% 2.2 roevicts 9282348 hit% 50 pagein 2934772 pageout 219075 dbname count free free% size userroot:ent 50000 2400 0.8 8972.7 userroot:dn 100000 4294735 69.8 130.0
dbscan -f /var/lib/dirsrv/slapd-instance_name/db/userRoot/id2entry.db -t 200 | \
grep -c rdn:
countcolumn of the
dbmon.shscript's output. Additionally, if all of the entries and DNs fit within their respective caches, the
userroot:entcount value matches the
dbmon.shscript example shows:
- Only 2.2% free database cache is left:
dbcachefree 397310 free% 2.2 roevicts 9282348 hit% 50 pagein 2934772 pageout 219075However, to operate efficiently, at least 15% free database cache is required. To determine the optimal size of the database cache, calculate the sizes of all
*.db4files in the
/var/lib/dirsrv/slapd-instance_name/db/directory including subdirectories and the changelog database, and add 12% for overhead.To set the database cache, see Section 6.5, “Setting the Database Cache Size”.
- The DN cache of the
userrootdatabase is well-chosen:
dbname count free free% size userroot:dn 100000 4294735 69.8 130.0The DN cache of the database contains 100000 records. 69,8% of the cache is free. Based on the
countvalue and the bytes used, each DN in memory requires 130 bytes on average.To set the DN cache, see Section 6.5, “Setting the Database Cache Size”.
- The statistics on the entry cache of the
userrootdatabase indicates that the entry cache value should be increased for better performance:
dbname count free free% size userroot:ent 50000 2400 0.8 8972.7The entry cache contains in this database 50000 records and only 2 Kilobytes of free space are left. To enable Directory Server to cache all 100000 DNs, reported by the
dbscanutility's output, the cache must be increased to minimum of 856 Megabytes (100000 DNs * 8972,7 bytes average entry size). However, it is recommended to round the minimum required size to the next highest Gigabyte and double the result. In this example, the entry cache should be set to 2 Gigabytes.To set the entry cache, see Section 6.3, “Setting the Entry Cache Size”.