[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: back-mdb locking strategies



Howard Chu wrote:
There are two main problems being addressed by the mdb approach - eliminating
multiple layers of cache copying, and eliminating multiple layers of locking.

Currently we have per-entry mutexes and also BDB locks for every cached item.
The mutex overhead is ridiculous, 40-some bytes per mutex x 10 million entries
is a lot of wasted storage. Especially since a single slapd can only actually
lock 2-3 items per thread - i.e., we only need on the order of 100 locks,
ever. The sane thing to do here is continue to use the BDB approach to
locking, but with fewer options.

Note that we can use this locking approach in back-bdb too, but aside from the memory savings I don't see it giving any performance gain. The real gain comes from completely eliminating one layer of locks, not just from streamlining one layer but keeping both layers.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/