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

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
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
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

Other popular topics Top

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
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement