[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: BDB Cache Size

--On Thursday, April 07, 2011 3:01 PM -0600 ldap@mm.st wrote:

One of the recommended ways we learned via this list (and other sources)
to determine the the bdb cache size is to get the size of the entire db
using this: "du -ch /var/lib/ldap/*.bdb".  Which we have done and seems
to be working good for the initial settings for our ldap rebuild.  We
have "set_cachesize 0 4153344 1" in our DB_CONFIG and the command
returns 4.1M.  We are going to put a simple monitor script in place to
keep an eye on the db size so we will have an indication that the cache
size may need to be increased as the size of the db grows.

Does anyone have any recommendations for  a threshold to use for
increasing the cache setting?   In other other words, if the db size
grows 10% larger than the cache setting, is that a good time to let the
admins know it is time to raise the cachesize?  Just looking for
suggestions on something to use as a trigger in a script.

There are two ways in which the DB cachesize is used.

a) When running slapadd to load a database. In this case, it will be fastest if the BDB cachesize matches the size of the entire db (du -ch *.bdb)

b) When slapd is running. In this case, it really only needs (id2entry.bdb + dn2id.bdb) size. This is always smaller than du -ch *.bdb

So if you tune your cache for (a) it will account for (b) with some growth. Personally, if you have plenty of RAM on the box, I'd just set your cache size to be a bit larger than you are now, say 50MB. It seems you have quite the small database if it is only 4.1MB in size.

Otherwise, yes, build a script to monitor the cache, and set an alert when it gets close to whatever threshhold you deem critical. If it is a slowly growing database, then perhaps 5%. If it grows quickly, then maybe 20%.



Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
Zimbra ::  the leader in open source messaging and collaboration