MNesia - Config Settings File?

412 views
Skip to first unread message

Steve Smith

unread,
Nov 26, 2018, 3:24:35 AM11/26/18
to rabbitmq-users
Hi,

I need to add some configuration in order to tune my MNesia settings (dc_dump_limit / dump_log_write_threshold & dump_log_time_threshold) in order to try and reduce the number of 'MNesia Overload' errors that clog our logs, but don't know where to add them.

Should they be in the Rabbit config file? I'm thinking that MNesia will already be up and running by the time Rabbit apps come to life?

Any advice (example or reference) most gratefully received please.

Steve

Luke Bakken

unread,
Nov 26, 2018, 4:36:36 PM11/26/18
to rabbitmq-users
Hi Steve,

Since you don't say what version of RabbitMQ you're using, I'll assume it's the latest version - 3.7.9

You need to pass those settings as arguments to the Erlang VM - docs: http://erlang.org/doc/man/mnesia.html#dump_log_time_threshold

Create the /etc/rabbitmq/rabbitmq-env.conf file with the following contents:

SERVER_ADDITIONAL_ERL_ARGS='-mnesia dc_dump_limit VALUE -mnesia dump_log_write_threshold VALUE -mnesia dump_log_time_threshold VALUE'

You will have to restart RabbitMQ to make these settings effective. To validate, you can run the following to ensure the arguments were passed to the VM (beam.smp):

ps -ef | fgrep beam.smp

Finally, please take note that tweaking mnesia in this way only addresses the symptoms of some larger problem, like slow disks or too much churn in declaring RabbitMQ entities like vhosts, queues, bindings, etc.

Thanks,
Luke

Steve Smith

unread,
Nov 27, 2018, 3:25:02 AM11/27/18
to rabbitmq-users
Thanks Luke,
The underlying problem is indeed a strategy we've inherited with a lot of exchanges (15k), each with a bound queue (15k+) and to cap it off queue mirroring over 3 of 5 nodes.
To paraphrase, 'right now I cant see the trees for the logs' so I'm trying to calm them down.
Thanks for your help.
Steve

Luke Bakken

unread,
Nov 27, 2018, 12:10:20 PM11/27/18
to rabbitmq-users
Hi Steve,

If these mnesia changes resolve your issue and / or improve your RabbitMQ cluster's performance, let us know as that may be valuable information to add to our documentation.

Thanks!
Luke

Steve Smith

unread,
Nov 28, 2018, 2:16:45 PM11/28/18
to rabbitmq-users
Hi Luke,
Apologies for the delay in getting back.
Our versions are: Erlang v21.0.1 & RabbitMQ v3.7.8
We're running our nodes on Windoze Server 2016.
We don't know if configuring MNesia has worked because we're unsure where to put the RabbitMQ-Env.bat file. (it should be .Bat rather than .Conf on Windows, right?). We're struggling quite badly understanding whet the hierchy for the files is.
Lastly, is there a way to find out if the settings we want are in fact active. Maybe there's an Erlang or MNesia console command we can run in Widows?
Regards
Steve
-------------------------------


On Monday, November 26, 2018 at 8:24:35 AM UTC, Steve Smith wrote:

Luke Bakken

unread,
Nov 28, 2018, 2:53:55 PM11/28/18
to rabbitmq-users
Hi Steve,

Yeah, it's important to let us know you're using Windows! You need to log in as the administrative user you used to install RabbitMQ. Then, as that user, create the %AppData%\RabbitMQ\rabbitmq-env-conf.bat file with this content:

set SERVER_ADDITIONAL_ERL_ARGS=-mnesia dc_dump_limit VALUE -mnesia dump_log_write_threshold VALUE -mnesia dump_log_time_threshold VALUE


Then, open the "RabbitMQ Command Prompt (sbin dir)" start menu item and run these commands in the shell that comes up:

.\rabbitmq-service.bat stop
.\rabbitmq-service.bat remove
.\rabbitmq-service.bat install
.\rabbitmq-service.bat start

After RabbitMQ starts, you can confirm settings this way:

.\rabbitmqctl.bat eval "application:get_env(mnesia, dc_dump_limit)."

It should show the VALUE from the configuration file. Repeat for each setting you customize.

Let me know how this process works.
Thanks,
Luke
Reply all
Reply to author
Forward
0 new messages