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