On Mon, Oct 20, 2014 at 1:53 PM, Howard Chu <hyc@symas.com> wrote:
My experience from benchmarking OpenLDAP over the years is that mutexes
scale only up to a point. When you have threads grabbing the same mutex from
across socket boundaries, things go into the toilet. There's no fix for
this; that's the nature of inter-socket communication.
argh. ok. so... actually.... accidentally, the design where i used
a single LMDB (one env) shared amongst (20 to 30) processes using
db_open to create (10 or so) databases would mitigate against that...
taking a quick look at mdb.c the mutex lock is done on the env not on
the database...
sooo compared to the previous design there would only be a 20/30-to-1
mutex contention whereas previously there were *10 sets* of 20 or 30
to 1 mutexes all competing... and if mutexes use sockets underneath
that would explain why the inter-process communication (which also
used sockets) was so dreadful.