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?