Wasteful communications between instances?
- Dominant language
- JavaScript
- Stars
- 2.4k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
Let me preface I have not started using cote yet - still in research phase before execution.
I opened this after looking into internals and I believe this is a source of @claustres's issue brought up in slack.
In a full mesh network of 100 instances I expect 200 messages per heartbeat interval (100 incoming, 100 outgoing)
Based on this:
https://github.com/dashersw/cote/blob/6b6d037f1cbad78417fb98bec4427d480d9dc2f9/src/components/component.js#L22
https://github.com/dashersw/cote/blob/955b85394ab246f3aced81f22f93ba07dece27d5/src/components/requester.js#L19
https://github.com/dashersw/cote/blob/c517ae2a74dfc56b2e0cb8b324362b4f2b8c9c08/src/components/responder.js#L14
https://github.com/dashersw/cote/blob/6b6d037f1cbad78417fb98bec4427d480d9dc2f9/src/components/subscriber.js#L13
https://github.com/dashersw/cote/blob/ac31387382e98a7bd22e37207a22fed08ba70496/src/components/publisher.js#L11
Each instance starts their own heartbeat process, so factor in say 10 requesters and 10 responders you now go to 20k messages per interval per process (2 million for the entire network per interval)
This is really inefficient.
Ideally, there should only be a single Discovery instance managed by the cote instance, and each requester/responder is tracked by the cote manager and the messages relayed accordingly.
This appears it would be an API breaking change if you consider .discovery public API (which seems like it might not be considered public API based on https://github.com/dashersw/cote/issues/99), but I believe this is critical to solving wasteful message processing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.