[erlang-questions] "Mnesia is overloaded"

Luke Gorrie luke.gorrie@REDACTED
Mon Jun 11 20:17:38 CEST 2007


Howdy!

I want to insert a lot of records efficiently into disc_copies /
disc_only_copies Mnesia tables and I don't need transactions.
What's the recommendation?

Today I'm using a series of mnesia:dirty_write calls but this
generates a lot of "Mnesia is overloaded...write_threshold" printouts
that I want to avoid.

I've tried starting with ram_copies and then switching to disk like this:

add_table_copy(Tab, Nodes, Type) ->
    lists:foreach(fun(Node) ->
                      mnesia:change_table_copy_type(Tab,Node,Type),
                      mnesia:add_table_copy(Tab,Node,Type) end,
                  Nodes).

on each node to switch table types at the end. But I have questions:

1. Is this code correct?
2. Is there a simpler way?

I'm running R9C-0.

Thanks!
-Luke





More information about the erlang-questions mailing list