Skip to content

Using Node.js's built-in load-balancer in cluster mode for better distribution requests among workers #1480

@firsturdiev

Description

@firsturdiev

bug description

Currently cobalt uses OS-level port-binding method for workers, in that way OS handles distribution of incoming requests among workers. But due to some OS-scheduling problems, it becomes very unbalanced, even node.js official warns about this:

Image

But in another (default) method, node.js itself handles distribution in round-robin fashion with some minor latency in much reliable way.

The main reason of spawning multiple workers in cobalt is benefiting from equal distribution of requests so in this case using node.js built-in method rather than OS-level port binding looks right approach.

Open to discuss more about this by technical side

source

cobalt's code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions