How do I choose how to save RABBITMQ messages?

Source: Internet
Author: User
Tags rabbitmq

RABBITMQ There are two ways to save a message in a queue: disc and RAM. If you use disc, you need to set Exchange/queue/delivery mode to durable. The advantage of the disc method is that when RABBITMQ fails, the message can still be resumed after a reboot. With RAM, RABBITMQ is much more efficient at handling message,and the efficiency ratio of RAM and disc in two ways is probably 3:1. Therefore, if there are other ha means to protect the situation, the choice of RAM method can improve the efficiency of Message Queuing.

If you use RAM, the amount of traffic that RABBITMQ can host depends on how much memory is available. RABBITMQ uses two parameters to limit the memory used by the system and avoids the system being monopolized by itself.

[{rabbit, [{vm_memory_high_watermark_paging_ratio, 0.75},          {vm_memory_high_watermark, 0.4}]}].

Vm_memory_high_watermark: Indicates that the upper limit of memory used by RABBITMQ is 40% of system memory. You can also make a specific amount of memory available through the absolute parameter. When RabbitMQ uses more memory than this limit, RabbitMQ will stream the message to the publisher until the memory is consumed back to normal.

Vm_memory_high_watermark_paging_ratio: Indicates that when RABBITMQ reaches 0.4*0.75=30%, the system will enable the paging mechanism for content in the queue, and the contents of the message will be paged to disk.

RABBITMQ memory usage can be queried through the Rabbitmqctl status or the Web UI in the management plug-in.

For the meanings of each memory entry, please refer to: https://www.rabbitmq.com/memory-use.html

What happens when a message is sent at a rate that exceeds the processing power of RABBITMQ?

RABBITMQ will automatically slow down the rate of this connection, so that the client side of the network bandwidth is reduced, the rate of sending messages will be limited, so as to achieve the purpose of flow control. Use "Rabbitmqctl list_connections" to view the connection, and if the status is "flow", the connection is in Flow-control state.

How do I choose how to save RABBITMQ messages?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.