Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to monitor mnesia load?

I sometimes get mnesia overloaded error message while using primarily async_dirty queries and ram_copies tables. So to understand what is going on I want to get more information about mnesia state such as number of queries per second or the size of query queue. I've searched a lot and found two probable approaches.

The first is mnesia:system_info function that can return a list of current transactions. But it seems not able to provide an information about non-transactional queries.

The second is subscribing to mnesia events, but using this way some active background processing is needed as well as manual subscribing to each table events.

Are there better ways of getting this information?

like image 468
citxx Avatar asked Mar 19 '14 10:03

citxx


People also ask

How Mnesia works?

Mnesia is centered around the idea of using a record to define a table's structure. Each table can thus store a bunch of similar records, and anything that goes in a record can thus be stored in a Mnesia table, including atoms, pids, references, and so on.

What is Mnesia in linux?

Mnesia is a distributed, soft real-time database management system written in the Erlang programming language. It is distributed as part of the Open Telecom Platform.

What is Mnesia table?

Mnesia is a truly distributed DBMS and the schema is a system table that is replicated on all nodes in a Mnesia system. This function fails if a schema is already present on any of the nodes in NodeList.


1 Answers

I know this isn't the most direct answer, and I'm not as familiar with the code as I was four years ago, but I once had the same question and made an erlang app that monitors mnesia write statistics serves an SVG graph of throughput:

Mnesia Graphs

If it's sort of something you want, the tests exercise the functionality: https://github.com/woahdae/mnesia_graphs/blob/master/test/mnesia_graphs_srv_tests.erl

If it's really something you want, I could take a second look at the project. I'm working in Erlang again, so it's a good exercise.

Also, yet another reminder of who a good README is for: yourself, four years later!

like image 154
Woahdae Avatar answered Oct 07 '22 04:10

Woahdae