Some places state 2GB period. Some places state it depends up the number of nodes.
相关问题
- Is “new” in Erlang part of the official standard a
- how to create a keep-alive process in Erlang
- ejabberd and Erlang installation with lager_transf
- Encrypt (cryptojs) - Decrypt (erlang)
- How to use erlang-examples
相关文章
- How do I modify a record in erlang?
- Check active timers in Erlang
- undefined function maps:to_json/1
- How to convert datetime() to timestamp() in Erlang
- what good orm api will work well with scala or erl
- GC performance in Erlang
- When to “let it crash” and when to defend the code
- Intercept login/logout ejabberd
Quite large if your question is "what's the storage capacity of an mnesia database made up of a huge number of
disc_only_copies
tables" - you're largely limited by available disk space.An easier question to answer is what's the maximum capacity of a single mnesia table of different types.
ram_copies
tables are limited by available memory.disc_copies
tables are limited by theirdets
backend (Hakan Mattsson on Mnesia) - this limit is 4Gb of data at the moment.So the simple answer is that simple
disc_copies
table can store up to 4Gb of data before they run into problems. (Mnesia doesn't actually crash if you exceed the on-disk size limit - the ram_copies portion of the table continues running, so you can repair this by deleting data or making other arrangements at runtime)However if you consider other mnesia features, then the answer is more complicated.
local_content
tables. If the table is alocal_content
table, then it can have different contents on each node in the mnesia cluster, so the capacity of the table is4Gb * <number of nodes>
4Gb * <number of fragments>
. (Sadly if you fragment your table, you then have to modify your table access code to usemnesia:activity/4
instead ofmnesia:write
and friends, but if you plan this in advance it's managable)As per the documentation, this is 4GB. Section 11.5
http://erlang.org/faq/mnesia.html
This answer contradicts the two existing answers when it comes to tables of type
disc_copies
. Let me first get a few general points out of the way:ram_copies
is only limited by available RAM (except if you're on a 32-bit machine). Data is stored in an ETS table.disc_only_copies
is stored in a Dets table. Dets tables are limited to 2 GB, because of limits in the file format.disc_copies
is stored both in RAM and on disk, so it is limited by available RAM - and perhaps something else?I'm going to try to show below that there is no specific limit imposed by Mnesia on the size of a
disc_copies
table. Note however that many Erlang programmers believe thatdisc_copies
tables are limited to 2 GB. That is stated in the accepted answer to this question, which at the time of writing outscores this answer by a factor of 7.disc_copies moved from dets to disk_log in 2001
It is commonly believed that
disc_copies
tables are backed by Dets tables. As far as I can tell, this was the case until Erlang/OTP R7B-4 (released on 30th September 2001). From the README:Look at the diff for more details, in particular
mnesia_lib.erl
andmnesia_loader.erl
.Sources supporting dets and a 2 / 4 GB limit
archelaus's answer draws from http://erlang.org/~hakan/mnesia_consumption.txt, which explains that
disc_copies
tables reside in ets and dets tables. However, looking at the index for the directory, we see that this document is dated 1999:It makes sense that it would say this, as it was written two years before the change.
Ray Boosen's answer draws from the Erlang FAQ:
The FAQ has been saying that since at least January 2001 (see the earliest copy in the Wayback Machine). That means that this FAQ entry dates from before the switch to disk_log, and hasn't been updated for a long time. (Anyway, the Dets table size limit is 2 GB, not 4 GB.) I submitted a pull request for the FAQ.
Sources supporting higher limits
The Learn You Some Erlang chapter on Mnesia says:
I'm not sure when this was written, but the text above exists in the earliest Wayback Machine copy, dated April 2012.
In a post on erlang-questions titled "beating mnesia to death (was RE: Using 4Gb of ram with Erlang VM)", dated 7th November 2005, Ulf Wiger writes:
Conclusions
The confusion seems to stem from missing or out-dated information from official sources:
LYSE seems to be the first "authoritative" source that mentions
disc_copies
tables not being subject to the Dets table size limit.