ourway

ourway

** WARNING ** Mnesia is overloaded: {:dump_log, :write_threshold}

What is this and what to do about it? (For dummies please)

First Post!

ConnorRigby

ConnorRigby

Nerves Core Team

A little more info might be useful? what are you trying to do? is this plain ole Elixir? Phoenix? Nerves? What deps? What is your end goal?

:mnesia is an OTP application. You can read about it here

Most Liked

ConnorRigby

ConnorRigby

Nerves Core Team

Without seeing any code my Google searches are as good as anyone else’s but I found this Which seems to cover most cases of those error happening.

Seems to me like too many writes from too many processes. (More than 100 specifically if the defaults haven’t changed since 2008)

cmkarlsson

cmkarlsson

You can (and probably should) use sync transactions as mentioned in the linked blog post. And it may be worth playing around with the dump threshold settings but in general the overload event means your system is doing more than it is capable of. If these events keep coming you need to have more resources. If the overload is just temporary it is fine. (I.e a short burst of writes coming in).

That said, one thing that helps with performance is to limit the number of concurrent writers. In my experience having 1 writer per scheduler seems to work pretty well. I think I picked this up from a talk from WhatsApp but can’t remember

You can also subscribe to the overloaded event and try to be proactive by using a circuit breaker of some sort (GitHub - jlouis/fuse: A Circuit Breaker for Erlang · GitHub for example). If you run mnesia in a distributed setting this may be a bit harder.

One talk that that briefly mentions this is Mnesia for the CAPper (Erlang Factory - Ulf Wiger, Uber Erlang programmer and CTO of Erlang Solutions) (I’m sure there is a video somewhere as well). This talk also contains a few other things that is good to know about mnesia.

Last Post!

ourway

ourway

Do you think using poolboy is a good option for pooling mnesia transaction writes?

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New

We're in Beta

About us Mission Statement