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:
|
this.sock.on('bind', () => this.startDiscovery()); |
|
this.sock.sock.on('bind', () => this.startDiscovery()); |
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 #99), but I believe this is critical to solving wasteful message processing.
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:
cote/src/components/component.js
Line 22 in 6b6d037
cote/src/components/requester.js
Line 19 in 955b853
cote/src/components/responder.js
Line 14 in c517ae2
cote/src/components/subscriber.js
Line 13 in 6b6d037
cote/src/components/publisher.js
Line 11 in ac31387
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 #99), but I believe this is critical to solving wasteful message processing.