HI!
Moving this thread here to openldap-devel because it's not a usage question anymore:
https://lists.openldap.org/hyperkitty/list/openldap-technical@openldap.org/m...
TL;DR: 1. Would you consider the attached patch as a valid solution? 2. Improving slapo-constraint would also help.
On 8/13/21 10:59 AM, Michael Ströder wrote:
On 8/13/21 1:51 AM, Howard Chu wrote:
Michael Ströder wrote:
Let there be ACLs with dn.regex="..", attrs=foo,bar and val.regex=".." in the <what> clauses.
Obviously depending on complexity of regex-pattern and length of DNs / avals the regex checking is more expensive than equality checking of attrs=.
Can I improve ACL performance by order of <what> clauses or are they processed in fixed order anyway? If in fixed order, which one?
The order is fixed, in order of increasing granularity. DN first, attribute next, value-specific last.
Is this order implemented in function slap_acl_get() in acl.c? The last seems to be filter= after val=. Right?
That is the only order that makes logical sense.
Why?
IMHO attrs= should be checked first because
dn.regex=".." val.regex=".." filter=".."
are all potentially way more CPU-intensive than checking attrs= against a simple hash-map.
First tests (OpenLDAP 2.5/master) show with customer ACLs reading all attrs of 100k user entries and one huge group entry takes
2m23.459s with standard acl.c
but only
1m22.718s with patched acl.c which evaluates attrs= before dn.regex= and val.regex=.
The reason for improved performance here is that the test data has one really big group entry (100k members) with expensive ACLs on uniqueMember attribute. Thus quickly skipping the ACLs with attrs=uniqueMember saves lots of CPU.
Yes, the tests are somewhat artificial and optimizing the clients is also needed. But anyway I'd like to avoid clients accidently causing unneeded load. And I expect this to also improve things for lots of smaller groups in real-world usage.
Ciao, Michael.
P.S.: The uniqueMember-ACLs are so complex because the original author wanted to work-around deficiencies of slapo-constraint. Have a set-relation for fully checking partical sets would make this problem go away...
P.P.S.: Before you ask: These are *not* tests with Æ-DIR ACLs.
P.P.P.S: I like the new etime= logging. :-)