Samba4 Full Active Directory Schema Issues?

Howard Chu hyc at
Fri Apr 3 02:42:43 GMT 2009

> As you would have seen in my mail yesterday, it seems there is much,
> much more work to do.  We started adding support for possibleInferiors
> yeasterday, and instead spent the day working on making the schema
> lookup more efficient. (binary search instead of walking a linked list
> every time).
> It turns out that with the previous code, just running with the larger
> schema had a large performance cost.

One word: caching.

One of the tricks I use in OpenLDAP is to use two AVL trees for schema 
lookups. One contains the complete schema as loaded in whatever configuration, 
the other only contains schema elements that were referenced by actual LDAP 
requests. In practice the number of unique schema elements referenced in any 
running LDAP instance is much smaller than the complete known set of schema; 
this trick is worth a fair bit of performance. (I.e., you first lookup in the 
small tree; if you miss in this cache then you lookup in the full tree, and 
insert the result into the small cache tree.)

The other obvious thing is to never use plain linked lists for data items that 
need to be looked up in dictionary fashion...

And now that I've let that cat out of the bag, I expect every other LDAP 
vendors' products to speed up by at least 10% in the next few weeks... Which 
will mean OpenLDAP will only be 4.8x faster than the second fastest, instead 
of 5x... ;)
   -- Howard Chu
   CTO, Symas Corp. 
   Director, Highland Sun
   Chief Architect, OpenLDAP

More information about the samba-technical mailing list