[rabbitmq-discuss] RabbmitMQ consuming CPU and Memory

Paul Gross pgross at gmail.com
Fri May 18 18:36:15 BST 2012

> That looks like a perfectly healthy rabbit.
> There are no user-defined exchanges, queues or bindings - is that 
> expected?
This server is running a build, which creates and deletes a couple of 
queues. It's possible that these creates/deletes are happening at the 
same time. Could this cause the observed behavior?

> In your original email you said that "all of a sudden [...] RabbitMQ 
> consumes all available CPU and memory", but in the report the memory 
> usage is shown as 90MB, which isn't very high.
> Are you sure that it is *rabbit* that is eating all the CPU & memory? 
> Please check the CPU/memory usage of the beam.smp process and include 
> that in your report next time the problem occurs.
The beam.smp process is definitely going nuts. Here's the output from ps 

rabbitmq 26472  0.0  0.0   4144     0 ?        S    May14   0:00 /bin/sh 
rabbitmq 26490  184 82.4 2367176 837356 ?      Sl   May14 9852:39  \_ 
/usr/lib/erlang/erts-5.9.1/bin/beam.smp -W w -K true -A30 -P 1048576 -- 
-root /usr/lib/erlang -progname erl -- -
rabbitmq 26605  0.0  0.0  10776     0 ?        Ss   May14   0:00      \_ 
inet_gethost 4
rabbitmq 26606  0.0  0.0  12876    36 ?        S    May14   
0:00          \_ inet_gethost 4

As you can see, beam.smp is using 184% CPU and 82.4% of memory on this 
server (4 cores, 1GB RAM).

Unfortunately, by the time I was able to ssh into the server to run 
rabbitmqctl report, it said nodedown.

Here's the output of report after I manually killed beam.smp and ran 
/etc/init.d/rabbitmq start:

Status of node 'rabbit at bt-ci-rabbitmq' ...
                         {os_mon,"CPO  CXC 138 46","2.2.9"},
                         {sasl,"SASL  CXC 138 11","2.2.1"},
                         {mnesia,"MNESIA  CXC 138 12","4.7"},
                         {stdlib,"ERTS  CXC 138 10","1.18.1"},
                         {kernel,"ERTS  CXC 138 10","2.15.1"}]},
  {erlang_version,"Erlang R15B01 (erts-5.9.1) [source] [64-bit] 
[smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},

Cluster status of node 'rabbit at bt-ci-rabbitmq' ...
[{nodes,[{disc,['rabbit at bt-ci-rabbitmq']}]},
  {running_nodes,['rabbit at bt-ci-rabbitmq']}]

Application environment of node 'rabbit at bt-ci-rabbitmq' ...
  {error_logger,{file,"/var/log/rabbitmq/rabbit at bt-ci-rabbitmq.log"}},
  {sasl_error_logger,{file,"/var/log/rabbitmq/rabbit at bt-ci-rabbitmq-sasl.log"}},



Queues on /:
pid    name    durable    auto_delete    arguments    owner_pid    
slave_pids    synchronised_slave_pids    exclusive_consumer_pid    
exclusive_consumer_tag    messages_ready    messages_unacknowledged    
messages    consumers    memory    backing_queue_status
<'rabbit at bt-ci-rabbitmq'.2.186.0>    
webhook_worker_master-testing_notifications    true    false    
[{"x-ha-policy","all"}]        []    []            0    0    0    0    
34688    [{q1,0}, {q2,0}, {delta,{delta,undefined,0,undefined}}, {q3,0}, 
{q4,0}, {len,0}, {pending_acks,0}, {target_ram_count,infinity}, 
{ram_msg_count,0}, {ram_ack_count,0}, {next_seq_id,0}, 
{persistent_count,0}, {avg_ingress_rate,0.0}, {avg_egress_rate,0.0}, 
{avg_ack_ingress_rate,0.0}, {avg_ack_egress_rate,0.0}, {mirror_seen,0}, 
<'rabbit at bt-ci-rabbitmq'.2.187.0>    gateway_master_test    true    
false    [{"x-ha-policy","all"}]        []    []            79    0    
79    0    88808    [{q1,0}, {q2,0}, 
{delta,{delta,undefined,0,undefined}}, {q3,79}, {q4,0}, {len,79}, 
{pending_acks,0}, {target_ram_count,infinity}, {ram_msg_count,0}, 
{ram_ack_count,0}, {next_seq_id,16384}, {persistent_count,79}, 
{avg_ingress_rate,0.0}, {avg_egress_rate,0.0}, 
{avg_ack_ingress_rate,0.0}, {avg_ack_egress_rate,0.0}, {mirror_seen,0}, 
<'rabbit at bt-ci-rabbitmq'.2.188.0>    gateway_release_test    true    
false    [{"x-ha-policy","all"}]        []    []            109    0    
109    0    142928    [{q1,0}, {q2,0}, 
{delta,{delta,undefined,0,undefined}}, {q3,109}, {q4,0}, {len,109}, 
{pending_acks,0}, {target_ram_count,infinity}, {ram_msg_count,0}, 
{ram_ack_count,0}, {next_seq_id,16384}, {persistent_count,109}, 
{avg_ingress_rate,0.0}, {avg_egress_rate,0.0}, 
{avg_ack_ingress_rate,0.0}, {avg_ack_egress_rate,0.0}, {mirror_seen,0}, 

Exchanges on /:
name    type    durable    auto_delete    internal    arguments
amq.direct    direct    true    false    false    []
amq.topic    topic    true    false    false    []
amq.rabbitmq.trace    topic    true    false    false    []
amq.rabbitmq.log    topic    true    false    false    []
amq.fanout    fanout    true    false    false    []
amq.headers    headers    true    false    false    []
     direct    true    false    false    []
amq.match    headers    true    false    false    []

Bindings on /:
source_name    source_kind    destination_name    destination_kind    
routing_key    arguments
     exchange    gateway_master_test    queue    gateway_master_test    []
     exchange    gateway_release_test    queue    gateway_release_test    []
     exchange    webhook_worker_master-testing_notifications    queue    
webhook_worker_master-testing_notifications    []

Consumers on /:

Permissions on /:
user    configure    write    read
guest    .*    .*    .*

End of server status report

More information about the rabbitmq-discuss mailing list