[erlang-questions] about multi process performance and single process performance on mnesia
Thu Apr 28 13:23:46 CEST 2011
On 28 Apr 2011, at 12:55, zhangbo wrote:
> Hi all,
> I caught some problems about mensia, here:
> 1, how about multi process performance on mnesia vs single process performance on it ?
Mnesia does have some issues regarding scalability on multi-core. There are a few sequential bottlenecks (activity logging, the lock manager, etc) that limit scalability, but mnesia does run faster on SMP than on non-SMP.
> 2, I remember mnesia will deal requests in sequence, is it right ?
There are some things that are serialised, but mnesia does as much as it can in parallel. For one thing, the central processes in mnesia are predominately non-blocking, so interleaving is pretty efficient without unnecessary waits.
> 3, what's the general solution about concurrent write operation on mnesia ?
Each process does as much of the work as it can, before asking the transaction manager to commit changes. For example, when doing a dirty write, the calling process performs the meta-data lookups before letting the transaction manager perform the actual update. For transactions, each process maintains the transaction store and involves the lock manger and transaction manager as needed.
Ulf Wiger, CTO, Erlang Solutions, Ltd.
More information about the erlang-questions