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

Re: bdb/hdb cachesize calculation

On 07/12/2010 07:40 PM, Quanah Gibson-Mount wrote:
--On Monday, July 12, 2010 5:01 PM +0200 openldap-ml@stresst.net wrote:

Attached to this message you'll find a quick and dirty bash script that
should determine the cachesize for an in-production bdb/hdb backend by
taking dn2id and id2entry as well as all existing indexes into account.

Internally the script calls the db_stat tool in combination with the
formulas found in the 2.4 admin guide under:

Are you trying to determine the size of the cache in use, or what the
size of the cache should be?  If it is the latter, you just use the du
-c -h output of *.bdb.  If it is the former, it sounds like your  script
isn't calculating the right data.

Ahh I see - thanks! It seems that we do not need to calculate the cachesize (see below). Nevertheless, as I'm using cn=config I'm a little bit confused regarding the available different cache settings: The related cn=config configuration directives are all prefixed by "olcDb..." where olcDbCachesize for example seems to store the related DB_CONFIG setting but olcDbDnCachesize seems to be focused on slapd internal use.

BTW: slapd.conf's "dbconfig" directive ("convenience settings" mentioned in man slapd-bdb.5) are not transformed into cn=config format when using slaptest -f -F (I'm using slapd 2.4.21). slapd.conf's dbconfig directive seems to be ignored during slaptest -f -F.

Last but not least please let me summarize my current understanding after reading AdminGuide2.4 once again:

Section 21.4.1. ==> Berkeley DB Cache

	21.4.1.(a) ==> slapadd import cachesize
	Cachesize is the overall filesize of *.bdb

	21.4.1.(b) ==> operation cachesize
	Cachesize is the filesize of id2entry.bdb + 10%

	BDB Cachesize is configureable various ways:
	- slapd.conf: (dbconfig ...)
	- cn=config: (olcDbCacheSize: x)
	- DB_CONFIG: (set_cachesize 0 x 1)
	DB_CONFIG (if exists) takes precedence

Section ==> Calculating Cachesize

	only needed in case the above file sizes do not completely fit
	into available free memory. As we've currently enough free RAM
	we can skip these calculations.

Section 21.4.2. ==> slapd(8) Entry Cache (cachesize)

	cn=config (olcDbDNcacheSize: y)

Section 21.4.3. ==> IDL  Cache (idlcachesize)

	cn=config (olcDbIDLcacheSize: z)
	recommendation: z=y (for bdb)
	recommendation: z=3x y (for hdb)