Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nwaku maximum connections reached for wss clients #23

Closed
2 tasks
jm-clius opened this issue May 8, 2023 · 8 comments
Closed
2 tasks

Nwaku maximum connections reached for wss clients #23

jm-clius opened this issue May 8, 2023 · 8 comments
Labels
E:2.1: Production testing of existing protocols See https://github.com/waku-org/pm/issues/49 for details

Comments

@jm-clius
Copy link

jm-clius commented May 8, 2023

Problem

The nwaku-based wakuv2.prod and wakuv2.test fleet are currently reaching maximum connection capacity very soon after every restart. This seems to be due to scripted js-waku based clients connecting to the secure websocket connections available on those nodes and not releasing those connections. This means that other clients interested in connecting to the fleet nodes for any services are unable to do so as we've reached service capacity. The connections seem to be used for relay protocol.

This presents at least two problems:

  • find a solution to managing/discouraging connection "hoggers", especially when providing scarce services to clients (such as store, filter, lightpush or even just wss listening ports).
  • due to how these specific connections are used, the node resources (especially memory usage) has climbed very high and the fleet nodes have slowed down considerably.

Steps being taken

@fryorcraken
Copy link
Contributor

Here are some action items for js-waku: waku-org/js-waku#1326

We are also working on using WebRTC for relay that should also decrease reliance on bootstrap nodes: waku-org/js-waku#1181

@fryorcraken
Copy link
Contributor

Few notes:

  1. Makes sense to de-prioritize Waku Relay connections over WSS, at least until [Epic] Waku Relay scalability in the Browser js-waku#905 is "done"
  2. Make also sense to de-prioritize Waku Light Push, Store and Filter connections (over any transport) over Peer exchange connections, so that discovery has priority.
  3. We may need to think/revisit how js-waku dials node. As it usually passes all protocols that are mounted. We do not mount relay if we don't intend to use so that's good news. However, we would usually mount and dial with peer exchange + light push + filter + store on the same connection. Maybe this should be changed? Maybe we should use two different connections for peer exchange and for light push + filter + store, WDYT @alrevuelta ?

@fryorcraken
Copy link
Contributor

We have deployed a number of improvements:

We have improved peer management in nwaku in general (specifically by introducing scoring and pruning on IP colocation max). We're also working on a strategy for service-only peer connection slots.

Looking at the number of peers, we can see drastic changes on the 19 June 2023. This could be because of a number of a factors, but the gossipsub scoring and disincentivising IP colocation plays at least a role.

@mfw78
Copy link

mfw78 commented Jun 25, 2023

Would the IP colocation limitation affect those behind NAT / CGNAT?

@alrevuelta
Copy link
Collaborator

@mfw78 Not really. The waku network aims to have a huge amount of nodes, so if one node drops your connection because of IP colocation (let say you run 10 devices under the same IP) thats fine, because there are many other nodes that you can connect to. In any case, forcing disconnection due to this it not only prevents attacks but also tries to enforce some diversity in the nodes that you are connected to.

@fryorcraken
Copy link
Contributor

New issue logged: waku-org/nwaku#1831

@fryorcraken
Copy link
Contributor

@jm-clius can this be closed? I have checked the grafana several times in the past few weeks and it seems much better.

@fryorcraken fryorcraken added Epic Tracks a sub-team Epic. E:2023-light-protocols labels Aug 29, 2023
@jm-clius
Copy link
Author

Yes, we still have work planned for peer management, but the main issue has been addressed.

@fryorcraken fryorcraken unpinned this issue Sep 7, 2023
@fryorcraken fryorcraken added E:2.1: Production testing of existing protocols See https://github.com/waku-org/pm/issues/49 for details and removed E:2023-light-protocols Epic Tracks a sub-team Epic. labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:2.1: Production testing of existing protocols See https://github.com/waku-org/pm/issues/49 for details
Projects
Status: Done
Development

No branches or pull requests

4 participants