Reputation: 57
what scaling options can we use if rabbitMQ metrices reaches a threshold?I have a VM on which RabbitMQ is running. If the queue length>90% of total queue length, can we increase the instance count by 1 and a with a separate queue such that they are to be processed on a priority basis?
In short what scaling options do we have based on different parameters for RabbitMQ
Upvotes: 2
Views: 2888
Reputation: 7095
Take a look into RabbitMQ Sharding Plugin
From their README:
RabbitMQ Sharding Plugin
This plugin introduces the concept of sharded queues for RabbitMQ. Sharding is performed by exchanges, that is, messages will be partitioned across "shard" queues by one exchange that we should define as sharded. The machinery used behind the scenes implies defining an exchange that will partition, or shard messages across queues. The partitioning will be done automatically for you, i.e: once you define an exchange as sharded, then the supporting queues will be automatically created on every cluster node and messages will be sharded across them.
Auto-scaling
One interesting property of this plugin, is that if you add more nodes to your RabbitMQ cluster, then the plugin will automatically create more shards in the new node. Say you had a shard with 4 queues in node a and node b just joined the cluster. The plugin will automatically create 4 queues in node b and join them to the shard partition. Already delivered messages will not be rebalanced, but newly arriving messages will be partitioned to the new queues.
Upvotes: 2