After a tip in another way, I was able to improve the query.
LDAP_MATCHING_RULE_IN_CHAIN can cause a heavy load and stress performance if the query itself is not optimized and not using indexes properly.
The example in the blog is an example of a such an expensive ldap query.
Cause it will walk over ALL AD objects whether it’s a group or a user or a contact or whetever else.
It sure will ensure the CPU of the DCs are running hot.
The Tip to put a few more complexity on the rule just the groups you need was a good example
Eg:
(&(objectclass=group)(&(|(cn=xyz_)(cn=aws-)(cn=abc_*))(member:1.2.840.113556.1.4.1941:={1})))
This would be a query looking only for the groups where the CN starts with xyz_ or aws- or abc_!