I've been running some tests with OpenLDAP 2.4.11 lately, with an
existing application that will use the LDAP as its backend for storing
users and roles.
Using bdb, performance is excellent. With hdb on the other hand, the
application is rendered unusable unless the searched entry is already
cached, as one particular search takes minutes to execute otherwise,
whereas in bdb the same search quite fast regardless. The specific
search is subtree (scope=2 deref=0) filtered on "o" and "objectclass"
like so: (&(objectClass=organization)(o=123456)).. Both attributes have
equality indexes. The whole directory has just over 4 million entries,
and about 500.000 of those are in the context being searched thanks to
the scope. The strange thing is how bdb is fast from search one, while
hdb with hdb it takes minutes to complete unless the entry is already
cached. I've tried configuring caches according to the faq-o-matic. The
docs mention that hdb requires a bigger idl cache in particular, to have
good search performance, so I've tried various cache sizes, up to 1
million for idl- and 330.000 for the entry caches, but this seems to
make slapd dig so deeply into virtual memory that I'm not sure if it
actually does more harm than good.