Waku v2 scalability studies

Thanks @haelius. Makes sense.

Continuing the discussion only considering Waku Relay.

While browser clients cannot provide connections to the network, they should still be able to create Waku Relay mesh with other (service node) peers, as long as they can connect to at least 4 peers: The recommended lower bound for outbound degree (D_low);

For this to happen, first we need browser clients to find peers beyond the bootstrap peers. Indeed, as previously stated in the thread, we are working on more dynamic discovery methods for the browser.

Based on these recommendations, let’s review the numbers needed to form healthy meshes.

I am not sure the best way to do these calculations, feedback is welcome.

Assumptions:

  • In this context, connect, means establishing a network connection and being included in each other gossip sub mesh.
  • 1 browser node should connect to 4 services nodes (D_low)
  • 1 service node should connect to 4 services nodes so that the mesh is somewhat reliable (D_low).
  • 1 node should not connect to more than 12 nodes (D_high)

So if we have 5 services nodes in a mesh, they can each establish connections to 4 other service nodes.

There are 8 “slots” per service node available in their mesh (12 - 4 = 8).
Hence, a total of 5 * 8 = 40 remaining slots.
Because a browser node takes 4 slots then 40 / 4 = 10 browser nodes can connect to those 5 services nodes before the meshes become saturated.

From this I deduce a ratio of 5 service nodes for 10 browser nodes: 1:2.

This ratio does not seem achievable in reality. I would hope that one service node can serve in the scale of thousand browser nodes (got this figure out of my hat).

One way to increase the ratio would be to increase D_high. However, the impact of such change on mesh performance would need to be studied.

Reliability for Browser nodes

Please note that due to the situation descibed above, by default, js-waku only connects to one remote node. This is lower than D_low. Which means that one is likely to see reliability issue when using Waku Relay with default parameters.
As we deliver the features discussed in this thread, we will be able to increase the default number of connection js-waku make so it can reach D_low (4) and even D (6).

2 Likes