[rabbitmq-discuss] Queues with high memory consumption

Pablo Molnar pablomolnar at gmail.com
Wed May 9 23:30:55 BST 2012


Actually is causing me headaches because the memory of the node keeps
rising to beyond the watermark level and that freezes all my rabbitmq
cluster. For instance right node I have a node with 4.3GB used with a
watermark of 4.7GB and all ndoe queues are updated (empties). I've pated
the node status and queue details below.

Any idea how to solve this?

curl .../api/nodes/rabbit at i-000000ed-wsm
{
   "name":"rabbit at i-000000ed-wsm",
   "type":"ram",
   "running":true,
   "os_pid":"6451",
   "mem_ets":54743192,
   "mem_binary":206280808,
   "mem_proc":4284714760,
   "mem_proc_used":4284698594,
   "mem_atom":2107665,
   "mem_atom_used":2076476,
   "mem_code":15225838,
   "fd_used":42,
   "fd_total":131072,
   "sockets_used":14,
   "sockets_total":117872,
   "mem_used":4645571200,
   "mem_limit":5017685196,
   "mem_alarm":false,
   "proc_used":618,
   "proc_total":32768,
   "statistics_level":"fine",
   "erlang_version":"R15B",
   "uptime":2203242331,
   "run_queue":5,
   "processors":4,
   "exchange_types":[
      {
         "name":"topic",
         "description":"AMQP topic exchange, as per the AMQP specification",
         "enabled":true
      },
      {
         "name":"fanout",
         "description":"AMQP fanout exchange, as per the AMQP
specification",
         "enabled":true
      },
      {
         "name":"direct",
         "description":"AMQP direct exchange, as per the AMQP
specification",
         "enabled":true
      },
      {
         "name":"headers",
         "description":"AMQP headers exchange, as per the AMQP
specification",
         "enabled":true
      }
   ],
   "auth_mechanisms":[
      {
         "name":"PLAIN",
         "description":"SASL PLAIN authentication mechanism",
         "enabled":true
      },
      {
         "name":"AMQPLAIN",
         "description":"QPid AMQPLAIN mechanism",
         "enabled":true
      },
      {
         "name":"RABBIT-CR-DEMO",
         "description":"RabbitMQ Demo challenge-response authentication
mechanism",
         "enabled":false
      }
   ],
   "applications":[
      {
         "name":"amqp_client",
         "description":"RabbitMQ AMQP Client",
         "version":"2.7.1"
      },
      {
         "name":"inets",
         "description":"INETS  CXC 138 49",
         "version":"5.8"
      },
      {
         "name":"kernel",
         "description":"ERTS  CXC 138 10",
         "version":"2.15"
      },
      {
         "name":"mnesia",
         "description":"MNESIA  CXC 138 12",
         "version":"4.6"
      },
      {
         "name":"mochiweb",
         "description":"MochiMedia Web Server",
         "version":"1.3-rmq2.7.1-git"
      },
      {
         "name":"os_mon",
         "description":"CPO  CXC 138 46",
         "version":"2.2.8"
      },
      {
         "name":"rabbit",
         "description":"RabbitMQ",
         "version":"2.7.1"
      },
      {
         "name":"rabbitmq_management",
         "description":"RabbitMQ Management Console",
         "version":"2.7.1"
      },
      {
         "name":"rabbitmq_management_agent",
         "description":"RabbitMQ Management Agent",
         "version":"2.7.1"
      },
      {
         "name":"rabbitmq_management_visualiser",
         "description":"RabbitMQ Visualiser",
         "version":"2.7.1"
      },
      {
         "name":"rabbitmq_mochiweb",
         "description":"RabbitMQ Mochiweb Embedding",
         "version":"2.7.1"
      },
      {
         "name":"sasl",
         "description":"SASL  CXC 138 11",
         "version":"2.2"
      },
      {
         "name":"stdlib",
         "description":"ERTS  CXC 138 10",
         "version":"1.18"
      },
      {
         "name":"webmachine",
         "description":"webmachine",
         "version":"1.7.0-rmq2.7.1-hg"
      }
   ]
}



rabbitmqctl status
Status of node 'rabbit at i-00000140-csm' ...
[{pid,739},
 {running_applications,
     [{rabbitmq_management_visualiser,"RabbitMQ Visualiser","2.7.1"},
      {rabbitmq_management,"RabbitMQ Management Console","2.7.1"},
      {rabbitmq_mochiweb,"RabbitMQ Mochiweb Embedding","2.7.1"},
      {webmachine,"webmachine","1.7.0-rmq2.7.1-hg"},
      {amqp_client,"RabbitMQ AMQP Client","2.7.1"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","2.7.1"},
      {rabbit,"RabbitMQ","2.7.1"},
      {os_mon,"CPO  CXC 138 46","2.2.8"},
      {sasl,"SASL  CXC 138 11","2.2"},
      {mochiweb,"MochiMedia Web Server","1.3-rmq2.7.1-git"},
      {inets,"INETS  CXC 138 49","5.8"},
      {mnesia,"MNESIA  CXC 138 12","4.6"},
      {stdlib,"ERTS  CXC 138 10","1.18"},
      {kernel,"ERTS  CXC 138 10","2.15"}]},
 {os,{unix,linux}},
 {erlang_version,
     "Erlang R15B (erts-5.9) [source] [64-bit] [smp:4:4] [async-threads:0]
[hipe] [kernel-poll:false]\n"},
 {memory,
     [{total,4404012432},
      {processes,4148260149},
      {processes_used,4148259728},
      {system,255752283},
      {atom,561761},
      {atom_used,550271},
      {binary,81414464},
      {code,15193946},
      {ets,86119376}]},
 {vm_memory_high_watermark,0.799999999904651},
 {vm_memory_limit,6712184012}]
...done.



Here I'm attaches the queue details. The first two queues consumes 3.5GB
https://gist.github.com/2649372



On Tue, May 8, 2012 at 8:22 AM, Matthias Radestock <matthias at rabbitmq.com>wrote:

> Pablo,
>
>
> On 07/05/12 19:28, Pablo Molnar wrote:
>
>> I'm trying to figure out why the memory consumption of some queues
>> are  extremely high although there is almost none messages ready to
>> consume.
>> For instance this queue has only 3 messages but consumes 2.4GB of
>> RAM.
>>
>
> That is not necessarily a problem, in particular ...
>
>  {
>>   "exclusive_consumer_tag":"",
>>   "messages_ready":0,
>>   "messages_unacknowledged":3,
>>   "messages":3,
>>   "consumers":25,
>>   "memory":2586777216,
>>   "slave_nodes":[
>>
>>   ],
>>   "backing_queue_status":{
>>      "q1":0,
>>      "q2":0,
>>      "delta":[
>>         "delta",
>>         "undefined",
>>         0,
>>         "undefined"
>>      ],
>>      "q3":0,
>>      "q4":0,
>>      "len":0,
>>      "pending_acks":3,
>>      "target_ram_count":0,
>>      "ram_msg_count":0,
>>      "ram_ack_count":0,
>>      "next_seq_id":72528926,
>>      "persistent_count":3,
>>      "avg_ingress_rate":42.**456013780009044,
>>      "avg_egress_rate":42.**456013780009044,
>>      "avg_ack_ingress_rate":42.**456013780009044,
>>      "avg_ack_egress_rate":42.**456013780009044
>>   },  ...
>>
>
> ...this is a slow-moving, but not idle queue. I suspect what happened is
> that at some point the queue did have lots of messages in it, hence
> requiring lots of memory. Those messages subsequently got drained, but the
> since the queue is slow moving it can take a while for Erlang's gc to
> reclaim memory.
>
> Unless this is causing any other problems I wouldn't worry about it.
>
>
>  rabbitmqctl status
>> Status of node 'rabbit at i-00000140-csm' ...
>> [{pid,20106},
>>  {running_applications,
>>     [{rabbitmq_management_**visualiser,"RabbitMQ Visualiser","2.7.1"},
>>      {rabbitmq_management,"RabbitMQ Management Console","2.7.1"},
>>      {rabbitmq_mochiweb,"RabbitMQ Mochiweb Embedding","2.7.1"},
>>      {webmachine,"webmachine","1.7.**0-rmq2.7.1-hg"},
>>      {amqp_client,"RabbitMQ AMQP Client","2.7.1"},
>>      {rabbitmq_management_agent,"**RabbitMQ Management Agent","2.7.1"},
>>      {rabbit,"RabbitMQ","2.7.1"},
>>      {os_mon,"CPO  CXC 138 46","2.2.8"},
>>      {sasl,"SASL  CXC 138 11","2.2"},
>>      {mochiweb,"MochiMedia Web Server","1.3-rmq2.7.1-git"},
>>      {inets,"INETS  CXC 138 49","5.8"},
>>      {mnesia,"MNESIA  CXC 138 12","4.6"},
>>      {stdlib,"ERTS  CXC 138 10","1.18"},
>>      {kernel,"ERTS  CXC 138 10","2.15"}]},
>>  {os,{unix,linux}},
>>  {erlang_version,
>>     "Erlang R15B (erts-5.9) [source] [64-bit] [smp:4:4] [async-threads:0]
>> [hipe] [kernel-poll:false]\n"},
>>  {memory,
>>     [{total,4736488576},
>>      {processes,3832122172},
>>      {processes_used,3832066481},
>>      {system,904366404},
>>      {atom,561761},
>>      {atom_used,551430},
>>      {binary,98523592},
>>      {code,15193946},
>>      {ets,717445688}]},
>>  {vm_memory_high_watermark,0.**6999999999761628},
>>  {vm_memory_limit,5873161011}]
>> ...done.
>>
>
> You may want to upgrade to the latest Erlang (R15B01) and rabbit (2.8.2),
> though I doubt that will make a difference.
>
>
> Regards,
>
> Matthias.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120509/de8c9417/attachment.htm>


More information about the rabbitmq-discuss mailing list