问题
What is the cost of creating multiple subscriptions on a topic? Does creating more subscriptions affect the broker, Bookkeeper or both?
I'm assuming it only adds work load to the broker but the work increased by adding another subscription is minimal since it would only have to duplicate the messages?
回答1:
In Pulsar, a topic (or a partition) is owned by a single Broker meaning that all reads and writes go through that broker. Brokers cache bookies entries in memory so that it can dispatch messages directly to all consumers. This will avoid a network round-trip and a possible disk read on bookies.
In addition, you should note that a broker must send data over the network for each subscription. This can lead to network saturation if you have a very high throughput.
Moreover Bookies also have a write/reach cache to reduce disk access.
来源:https://stackoverflow.com/questions/64603078/what-is-the-cost-of-having-multiple-subscriptions-in-pulsar