Integration / RabbitMQ Interview Questions
How do you troubleshoot memory alarms in RabbitMQ?
A memory alarm fires when a node's memory use crosses vm_memory_high_watermark, and RabbitMQ responds by blocking publishers on the affected node until memory drops - a state visible in the management UI as flow control.
- Confirm the alarm with
rabbitmqctl statusor the management UI's node page, which shows current memory use versus the watermark. - Find the culprit queues using
rabbitmqctl list_queues name messages memoryto spot queues holding an unexpectedly large backlog. - Check for stuck consumers - a large "unacked" count often means a consumer stopped acking, so messages pile up in memory waiting for acknowledgment.
- Reduce memory pressure by draining the backlog, enabling lazy-queue-style behavior for large queues so messages page to disk sooner, or scaling out consumers.
- Only as a last resort, raise
vm_memory_high_watermark, and only after confirming the node actually has the physical RAM headroom to support it.
Treat the watermark increase as a temporary safety valve, not a fix - the underlying backlog or slow-consumer problem still needs addressing.
More Related questions...