Rabbitmq's memory disk monitoring

Rabbitmq's memory disk monitoring

When the memory usage exceeds the configured threshold or the remaining disk space is for the configured threshold, RabbitMQ will temporarily block the client's connection and stop receiving messages from the client to avoid server crashes and the mentality of the client and the server The detection mechanism will also fail.

As shown in the figure below:
Insert picture description here
When blocking or blocked appears, it means that it has reached the same value and high load operation.

Official website: https://www.rabbitmq.com/configure.html

rabbitmqctl set_vm_memory_high_watermark <fraction>
rabbitmqctl set_vm_memory_high_watermark absolute <memory_limit>

Insert picture description here
Configuration file rabbitmq.conf

vm_memory_high_watermark.relative = 0.4  建议0.4-0.6
vm_memory_high_watermark.absolute = 1024MB 

Memory paging:
Before a Broker node and the memory block producer, it will try to paging the messages in the queue to disk to free up memory space. Both persistent and non-persistent
messages will be written to the disk, which is persisted The message itself has a copy in the disk, so the persistent message will be
cleared from the memory during the transfer process .

By default, when the memory reaches the threshold of 50%, it will be paged.
In other words, when the threshold of the memory is 0.4 by default, when the memory exceeds 0.4*0.5=0.2, a page change action will be performed.

For example, with 1000MB of memory, when the memory usage reaches 400MB, it has reached the limit, but because of the configured paging memory 0.5, at this time
, 200MB of the memory will be transferred to the disk before reaching the limit of 400mb. So as to achieve stable operation.

vm_memory_high_watermark_paging_ratio = 0.75

Set less than 1, otherwise it is meaningless

Disk early warning
When the remaining space of the disk is lower than the certain word value, RabbitMQ will also block the producer, which can avoid running out of
disk space due to the continuous paging of non-persistent messages and causing the server to crash.

By default: the warning will be given when the disk warning is 50MB. Indicates that when the current disk space is 50MB, the producer will be blocked and
the process of paging memory messages to disk will be stopped .

This value can be reduced, but it cannot completely eliminate the possibility of collapse due to exhaustion of the base disk. For example, in the gap between two disk space checks, the first
check is 60MB, and the second check may be IMB, and a warning will appear.
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43803285/article/details/115035911