Skip to content

Wasteful communications between instances? #210

@aikar

Description

@aikar

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:

startDiscovery() {

this.startDiscovery();

this.sock.on('bind', () => this.startDiscovery());

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions