Search code examples
azureazureservicebusazure-servicebus-queues

Limit on number of partitions in service bus queue


Is there any limitation on the number of partitions I can have in a service bus queue? Documentation mentions some limits but doesn't mention anything about the no. of partitions.

Currently Service Bus imposes the following limitations on partitioned queues and topics: Partitioned queues and topics aren't supported in the Premium messaging tier. Sessions are supported in the premier tier by using SessionId. Partitioned queues and topics don't support sending messages that belong to different sessions in a single transaction. Service Bus currently allows up to 100 partitioned queues or topics per namespace. Each partitioned queue or topic counts towards the quota of 10,000 entities per namespace (doesn't apply to Premium tier).

Looking at the service bus queue page on Azure portal:

enter image description here

Is it something different or can we have only 16 partitions as mentioned on the Azure portal?

Similar question but doesn't completely answer the question since no documentation for this is available: Are there any limitation on the number of partitions in a Azure Service Bus Queue or Topics?


Solution

  • See documentation page on enabling partitioning:

    In a Standard tier namespace, you can create Service Bus queues and topics in 1, 2, 3, 4, or 5-GB sizes (the default is 1 GB). With partitioning enabled, Service Bus creates 16 copies (16 partitions) of the entity, each of the same size specified. As such, if you create a queue that's 5 GB in size, with 16 partitions the maximum queue size becomes (5 * 16) = 80 GB.

    Partitioning option is just a checkbox (in the Portal) or command-line option (--enable-partitioning true). As stated in the docs above, the number of partitions is always 16.