[erlang-questions] Mnesia slow down system performance when table size reaches a certain value

Michael Turner <>
Wed Sep 5 13:52:26 CEST 2012

On Wed, Sep 5, 2012 at 5:33 PM, Dan Gudmundsson <> wrote:
> Is it a bag table, If so how unique are your keys?
> Do you have an index on table, if so how unique are the secondary keys?
> Insertion time in bags are linear, (and indices are bag tables).

Dan, that would explain a relatively smooth degradation in
performance, as size goes up. What's being reported here doesn't sound
like that. Quantum leaps in execution time are often caused by a level
of the memory hierarchy getting maxed out, by something that's doing a
comprehensive scan of data that, up to a point, fits in that level of
the hierarchy. With CPU load going to (near-) zero, sounds like the
level is that of virtual memory: thrashing, I/O bound through
page-replacement. Even if that's the case here, the mystery is why
deleting some records doesn't "fix" the problem.

-michael turner

> On Wed, Sep 5, 2012 at 8:02 AM, Solomon <> wrote:
>> I set up a web server with erlang and use mnesia to save the session.
>> I test server, at beginning, system run well and cpu load were about 90%.
>> Whe session table size reached a certain value, most web requests were
>> failure, and cpu were idle. I delete some records in session table, but it
>> were not worked, then I used mnesia:clear_table/1 to clear session, system
>> run normal again.
>> _______________________________________________
>> erlang-questions mailing list
>> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list