Skip to content

alainrk/node-balancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJs simple clustered Load Balancer

stability-experimental js-standard-style

Start consul (service registry)

consul agent -dev

Start load balancer as cluster

npm start

Start your services

forever start --killSignal=SIGINT example/app.js api
forever start --killSignal=SIGINT example/app.js api
forever start --killSignal=SIGINT example/app.js webapp

Call services through load balancer

curl localhost:8080/api
curl localhost:8080/web

TODO

  • Setup tests on basic interface of balancer itself
  • Support different service registry
  • Better handling of sigterm/kill (pause on fork, notify about it, ...)
  • Cli (?):
    • Parametrize clusterization
    • SR configuration

Credits

Inspired by NodeJs Design Patterns - HTTP Dynamic Load Balancer

Releases

No releases published

Packages

No packages published