Skip to content

cluster: add new ip-hash scheduling policy

Rodrigo Muino Tomonari requested to merge github/fork/medns/pr_cluster into master

Clients with the same remote address can be distributed to the same worker by using the new cluster scheduling policy SCHED_IP :

const cluster = require('cluster');
cluster.schedulingPolicy = cluster.SCHED_IP;

or

export NODE_CLUSTER_SCHED_POLICY=ip

Thus like WebSocket will work as expected, on cluster.

It can works correctly with IPv4 and IPv6.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading