Debugging rabbitmq, sparse tricks

This page lists some common tricks used with RabbitMQ: handle with care!

Suspicious processes

While investigating some strange behavious of RabbitMQ I stumbled upon a web page asking to execute the following on rabbitmq server:

rabbitmqctl eval "rabbit_diagnostics:maybe_stuck()."

The above command should normally print output similar to:

root@juju-7ef1b9-74-lxd-2:/home/ubuntu# rabbitmqctl eval "rabbit_diagnostics:maybe_stuck()."
There are 10905 processes.
Investigated 0 processes this round, 5000ms to go.
Investigated 0 processes this round, 4500ms to go.
Investigated 0 processes this round, 4000ms to go.
Investigated 0 processes this round, 3500ms to go.
Investigated 0 processes this round, 3000ms to go.
Investigated 0 processes this round, 2500ms to go.
Investigated 0 processes this round, 2000ms to go.
Investigated 0 processes this round, 1500ms to go.
Investigated 0 processes this round, 1000ms to go.
Investigated 0 processes this round, 500ms to go.
Found 0 suspicious processes.
ok

but there may be cases where N suspicious processes are found.

Warning

CAVEAT: I am not absolutely sure that having a huge number of suspicious processes is bad for Rabbit.

However, if you want to clean some of them you may try the following:

  • from the output of previous command identify lines like:

    [{pid,<5490.58.0>},
    

    you see the word pid followed by three numbers

  • forget about the first number and execute (note that dots have been replaced by commas):

    rabbitmqctl eval 'erlang:exit(c:pid(0,58,0),kill).'