1.1.0 • Published 9 years ago

scale.io v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

scale.io

loadbalancing and autoscaling module for websocket based EC2 cluster without ELB.

architecture

  • no ELB

architecture

  • slack based monitoring

monitoring1

monitoring2

  • zero downtime deploy
  • multi-AZ based
  • auto fail over

how to use

scale.js

require('scale.io');

set config yml file

set config/default.yaml or config/env.yaml your main app.

Example is this.

execute

node --harmony scale.js

config details

conf for redis / aws / slack

enter your

  • redis host & port
  • access key id, secret access key and region
  • slack info

conf for loadbalancing / autoscaling / monitoring

enter some info (details are below).

conf for loadbalancing

Correspond to A and B in above structure chart.

keydesc
timeoutThresholdForRedHostGetting no response within this value(ms), host is regard as RedHost(=DyingHost).
connNumForRedHostRedHost is expressed by this value at loadbalancing log.
ec2HostTagKeyEC2 tag key
ec2HostTagValueForLobbyEC2 tag value for lobby server.
ec2HostTagValueForGameEC2 tag value for game server.
intervalForAutoscalingSeccycle time of autoscale watching process
intervalForHostInfoUpdateSeccycle time of loadbalancing process
redisKeyForLobbyLoadbalancingredis key name for lobby loadbalance.
redisKeyForGameLoadbalancingredis key name for game loadbalance.

conf for autoscaling

Correspond to C in above structure chart.

keydesc
cfnStackNamestack name of cloudformation.
serverTypeNumserver type number. if you use lobby and game, enter 2.
scaleOutThresholdaverage connection number of instances for scale out.
scaleInThresholdaverage connection number of instances for scale in.
cfnUpdateCmdupdate cloudformation command.
minimumGreenHostsNumfalling below this value, scale out starts.
forceScaleOutStartAtscale out forced to start after this time.
forceScaleOutEndAtscale out forced to start before this time.
scaleInAvailableStartAtscale in can be started after this time.
scaleInAvailableEndAtscale in can be started after this time.
notifyRoomNumMessagenotifying message by slack.
scaleInMinimumIntervalSecscale in can be started countinuously after this interval.
scaleOutMinimumIntervalSecscale out can be started countinuously after this interval.
specifiedTimeGreenHostsNuminstance number will be change to this value between specified time.
restartCmdrestart autoscale process commond.
autoRestartCpuUsageThresholdForLBif cpu usage exceed this value, process restart.
autoRestartMonitorIntervalSecmonitoring span for auto restart.

conf for monitor

Correspond to D in above structure chart.

keydesc
monitoredHostmonitored target.
monitoredProcesslike 'game', 'lobby'
monitoringIntervalSecmonitoring span
decisionIntervalSecmonitored process does not reply throughout this span, it is regard as died.
1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago