William.Zhang wrote:
Quote:
i am using OpenLdap which takes berkeley db as its backend database.
i am now wondering of the 2 config parameters:
'cachesize' belongs to OpenLdap to set the cache size of ldap
entries.
'set_cachesize' belongs to bdb to set the in memory db size.
but what the difference of these 2 ? |
I thought I already answered this on the OpenLDAP list and FAQ-o-Matic...
The most obvious difference is that the slapd cache contains structured
LDAP entries, while the BDB cache contains raw bytes. That is why the
slapd cache is sized in units of "entries" and the BDB cache is sized in
units of "bytes".
Quote:
if i want to read entries as many
as possiable, which one should i set ? |
I presume you mean "as many entries as possible in the shortest amount
of time." You can read *all* the entries even using a slapd entry cache
size of zero.
OpenLDAP uses BDB Btrees to store its data. In Btrees there are a lot of
internal pages that describe the structure of the Btree, and all of the
application data resides in leaf pages. To get good search performance
the BDB cache needs to be large enough to contain the internal pages
that are navigated to reach a leaf page, as well as containing the leaf
page itself. Aside from this, you'll need extra space allocated to
assure good write performance.
The other way to approach this question is simply to ask "how much BDB
cache is enough?" Using db_stat -m will tell you: if you run a query and
db_stat -m shows that no pages were forced from the cache, then you know
you have enough BDB cache.
Because the on-disk data format that is used to store entries in BDB is
not directly usable as an in-memory data structure, there is a
significant performance boost for searches by making the slapd back-bdb
entry cache as large as possible, and minimizing the use of the BDB cache.
--
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/