0

I have a case where the total memory used by RabbitMQ is 6.2 GB, and 6.1 GB of which are utilized by Erlang writers. However, I can not find this size paged anywhere on the hard disk. what happens if RabbitMQ crashes? will I lose all data?

Memory Utilization

Please check the below rabbitmqctl status

{memory,

 [{total,6692084888},

  {connection_readers,99864},

  {connection_writers,25697536},

  {connection_channels,95040},

  {connection_other,1942280},

  {queue_procs,189536},

  {queue_slave_procs,0},

  {plugins,645288},

  {other_proc,14228968},

 {mnesia,101896},

  {mgmt_db,615664},

  {msg_index,14967232},

  {other_ets,5246072},

  {binary,6598589536},

  {code,22475925},

  {atom,883633},

  {other_system,6306418}]},

  {alarms,[memory]},

  {listeners,

 [{clustering,25672,"::"},

  {amqp,5672,"127.0.0.1"},

  {'amqp/ssl',5671,"::"},

  {'stomp/ssl',61614,"::"}]},

   {vm_memory_high_watermark,0.4},

   {vm_memory_limit,6687214796},

  {disk_free_limit,819462080},

  {disk_free,2658975744},

 {file_descriptors,

 [{total_limit,924},

  {total_used,23},

  {sockets_limit,829},

  {sockets_used,19}]},

  {processes,[{limit,1048576},{used,407}]},

   {run_queue,0},

   {uptime,151129}]
  1. What happens when RabbitMQ fails or crashes, are messages in the queues get lost, or what?
  2. What is the difference between msg_store_persistent and msg_store_transient?

Erlang R16B03 (erts-5.10.4)

RabbitMQ version 3.4.2

Thanks

womble
  • 96,255
  • 29
  • 175
  • 230
skipper42
  • 1
  • 1

1 Answers1

0
  1. "What happens when RabbitMQ fails or crashes, are messages in the queues get lost, or what?"

    It depends on what you told RabbitMQ.

    If you use durable queues and your publishers send persistent messages, then the risk of loosing data is small, because persistent messages are written to disk as soon as they reach durable queues. In addition, RabbitMQ offers the "Confirms" extension to let publishers know when a message was actually queued and, when relevant, written to disk.

    If you don't use durable queues and persistent messages, messages are lost when the broker restarts or crashes.

  2. "What is the difference between msg_store_persistent and msg_store_transient?"

    • msg_store_persistent contains persistent messages queued on durable queues. Those messages are written to disk as soon as they enter a queue. Furthermore, they will still be available after a restart or a crash of the broker.
    • msg_store_transient contains other messages which were paged to disk to free some memory. This message store is basically emptied during RabbitMQ startup.

About the memory consumption you see, several memory leaks were fixed in RabbitMQ since 3.4.2. If you still see this behavior with a more recent version, please describe your workload in details.