A Full Futured NODE.JS Application Running and Scaling Framework
- Nice Framework Structue
- Ability to Check if a Port is Blocked
- Search for Free Port to Start Instance
- Search for Free Socks to Start Instance
- Register Servers and Only Balance to Registered Running Instances.
- Start Instances Prefork or OnDemand
- Supports http and https protocols
- Port forwarding
- Add Futures :D
- Choose Config file or Command Line Parameters
- Choose Logging Method: Current only file (Large IO),
- Adding MongoDB For Server Registering and Log (Trim Log??)
- Adding Auto Scale Algos (Framework for Cloud and Server Farm as Single Server)
$ npm i scale -g
$ scale -h
Usage: scale [options] [command]
Commands:
config show config
start start scale
stop stop scale
restart restart scale
* unknown command
Options:
-h, --help output usage information
-V, --version output the version number
-e, --edit edit config
$ scale start
info: starting scale on port 4141
$ scale config # show configh
$ scale -e config # edit config
# Root directory to store scale data
root: $HOME/.scale
# Port on which scale runs
port: 1431
# List of servers to balance load
DEPRICATED!!!!!
XXXXXX servers:
XXXXXX - name:
XXXXXX protocol: # http/https
XXXXXX hostname:
XXXXXX port:
DEPRICATED!!!!!
use // Listen to a specified port, or default to 8000
server.listen(require('seaport').connect('localhost', 9090).register('server'));
and start seaport server befor on 9090 ;)
# Routing technique
technique: # random/roundrobin
# Port forwarding
forward:
- port:
target:
hostname:
port:
Example npm/lib/node_modules/scale/config.yml
servers:
- name: s1
protocol: http
hostname: httpbin.org
- name: s2
protocol: http
hostname: stackoverflow.com
- name: s3
protocol: http
hostname: www.yahoo.com
technique: random
forward:
- port: 4545
target:
hostname: localhost
port: 22