# Phoenix.Pubsub subscriptions performance

**URL:** <https://forum.elixirforum.com/t/phoenix-pubsub-subscriptions-performance/20644>\
**Category:** Questions\
**Tags:** phoenix, phoenix\_pubsub, swarm\
**Created:** [March 5, 2019, 5:39pm UTC](https://forum.elixirforum.com/t/phoenix-pubsub-subscriptions-performance/20644 "2019-03-05T17:39:05Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![blquinn](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/blquinn/32/14314_2.png) [@blquinn](https://forum.elixirforum.com/u/blquinn)\
**Post date:** [March 5, 2019, 10:11pm UTC](https://forum.elixirforum.com/t/phoenix-pubsub-subscriptions-performance/20644/5 "2019-03-05T22:11:31Z")

</div>

True, your points about the load tests make sense.

I do think that, while any tests are nice to see, they need to be a little more real world to be truly valuable. In order to prove the actual throughput of the system, it should run clustered, then each client should create a bunch of subscriptions and also send/receive a few messages. That would be closer to a real world use case of the framework. (Well the streaming parts at least)

It’s hard to know what 500,000 msgs/sec on a laptop will actually translate to on for instance, cloud infrastructure. It’s hard to compare sending messages on a loopback device to really sending them over the network. You can stream 100’s of GB’s/sec on loopback. My point being that broadcasting to all nodes on the cluster could pose a much larger problem when some of your nodes might be far away. Furthermore, if you broadcast to all nodes in the cluster on every message send, you can effectively divide that number by the number of nodes that you have in terms of throughput of the pubsub system.

Other pubsub systems that I’ve seen broadcast the subscriptions (potentially with gossip) to all nodes, then use crdt’s to ensure they’re sync’d at intervals. This way you always have all of the subscriptions stored locally, at least within the sync interval. The benefit being that you can route messages to only the interested nodes.

It’s also nice for the node that receives the message to know immediately who needs to receive the message and who doesn’t need the message immediately. This would be great for instance for sending push notifications to users who aren’t currently connected, though perhaps you could use presence for that.

The current architecture does seem a bit easier to understand and perhaps more reliable, but I guess I’m just wondering if you ever considered the eventual consistency route.

---

_[View the full topic](https://forum.elixirforum.com/t/phoenix-pubsub-subscriptions-performance/20644)._
