--On Wednesday, August 24, 2022 12:27 PM +0200 Norbert openldap@freakix.de wrote:
Hi,
with OpenLDAP 2.4.47 (running on Debian 10) but also with 2.5.13 from ltb-project.org (running on same Debian 10) I can observe the following:
given following rough idea of a tree
o=base |- bn=subtree1 | - handful of entries |- bn=subtree2 | - millions of entries |- bn=subtree3 | |- bn=sub-subtree1 | |- bn=sub-subtree2 | |- some entries |- bn=subtree4
ou is an indexed attribute with pres,eq,sub.
Two comments:
a) pres indices are almost always worthless. They are only needed if you're going to be presence checking on an attribute that exists in < 50% of the entries. Do you really do presence checks on ou? See also https://www.openldap.org/doc/admin26/tuning.html#Presence%20indexing
Is there something which can be improved by changing the configuration?
You probably want to increase the IDL range if you truely have millions of entries. See also:
https://www.openldap.org/doc/admin26/tuning.html#Indexes
and
Specifically the section on "idlexp".
In my current production environment, I have:
dn: olcBackend={0}mdb,cn=config objectClass: olcBackendConfig objectClass: olcMdbBkConfig olcBackend: {0}mdb olcBkMdbIdlExp: 18
Note that olcBkMdbIdlExp is type "backend" and not "database", and applies to *all* mdb databases in the configuration. You will have to re-index the database after setting this, I'd suggest doing that offline with slapindex -q.
Regards, Quanah