rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

WIP: Add per-queue-type disk limits

Open the-mikedavis opened this issue 4 months ago • 1 comments

This is an extension of the idea of the free disk space alarm. That option enables blocking publishers when the free disk space on the data dir's disk falls below some threshold. This feature blocks publishers of individual queue types when the disk space taken by the queue type exceeds the configured threshold.

This change is incomplete: it only affects QQs and streams and AMQP 0-9-1 so far. I thought I'd open this as a draft early though to hear if anyone has thoughts on this as a feature.

How to demo the changes...
  1. make run-broker RABBITMQ_CONFIG_FILE=example.conf
  2. In that shell start the monitor rabbit_queue_type_disk_monitor:start_link() (should become part of a sup tree eventually)
  3. Start a QQ producer/consumer perf-test -qq -u qq -x 1 -y 1 --rate 5 --confirm 5
  4. Start a stream producer/consumer perf-test -sq -u sq -x 1 -y 1 --rate 5 --confirm 5
  5. Go to the QQ data dir: cd /tmp/rabbitmq-test-instances/<node>/mnesia/<node>/quorum/<node>/
  6. Create a big file larger than the QQ disk limit: dd if=/dev/zero of=ballast.bin bs=1G count=3
  7. Wait a few seconds and notice that the QQ perf-test command has stopped but not the stream one.
  8. rm ballast.bin and the QQ perf-test command should continue

the-mikedavis avatar Jun 16 '25 16:06 the-mikedavis