<div dir="ltr"><div>I've found that taking a large amount (from 1000 and upwards) of mnesia locks in the same transaction scales poorly. It seems to boil down to mnesia_locker keeping a bag ets table to store the reference between a transaction id (TID) and all locks held by the transaction.</div>
<div><br></div><div>Changing the ets table to an ordered set table, and tweaking the code to preserve the same semantics seems to dramatically improve the scaling.</div><div><br></div><div>If you need a test program to show the effect, just tell me.</div>
<div><br></div><div>Links:</div><div><br></div><div><a href="https://github.com/erlang/otp/pull/382">https://github.com/erlang/otp/pull/382</a><br></div><div><br></div><div>git fetch git@github.com:gorillainduction/otp.git improve_mnesia_locker_complexity<br>
</div><div><br></div><div><a href="https://github.com/gorillainduction/otp/compare/erlang:maint...improve_mnesia_locker_complexity">https://github.com/gorillainduction/otp/compare/erlang:maint...improve_mnesia_locker_complexity</a><br>
</div><div><a href="https://github.com/gorillainduction/otp/compare/erlang:maint...improve_mnesia_locker_complexity.patch">https://github.com/gorillainduction/otp/compare/erlang:maint...improve_mnesia_locker_complexity.patch</a><br>
</div><div><br></div><br></div>