loadbalancing and autoscaling module for websocket based EC2 cluster without ELB.
- no ELB
- slack based monitoring
- zero downtime deploy
- multi-AZ based
- auto fail over
require('scale.io');
set config/default.yaml
or config/env.yaml
your main app.
Example is this.
node --harmony scale.js
enter your
- redis host & port
- access key id, secret access key and region
- slack info
enter some info (details are below).
Correspond to A and B in above structure chart.
key | desc |
---|---|
timeoutThresholdForRedHost | Getting no response within this value(ms), host is regard as RedHost(=DyingHost). |
connNumForRedHost | RedHost is expressed by this value at loadbalancing log. |
ec2HostTagKey | EC2 tag key |
ec2HostTagValueForLobby | EC2 tag value for lobby server. |
ec2HostTagValueForGame | EC2 tag value for game server. |
intervalForAutoscalingSec | cycle time of autoscale watching process |
intervalForHostInfoUpdateSec | cycle time of loadbalancing process |
redisKeyForLobbyLoadbalancing | redis key name for lobby loadbalance. |
redisKeyForGameLoadbalancing | redis key name for game loadbalance. |
Correspond to C in above structure chart.
key | desc |
---|---|
cfnStackName | stack name of cloudformation. |
serverTypeNum | server type number. if you use lobby and game, enter 2. |
scaleOutThreshold | average connection number of instances for scale out. |
scaleInThreshold | average connection number of instances for scale in. |
cfnUpdateCmd | update cloudformation command. |
minimumGreenHostsNum | falling below this value, scale out starts. |
forceScaleOutStartAt | scale out forced to start after this time. |
forceScaleOutEndAt | scale out forced to start before this time. |
scaleInAvailableStartAt | scale in can be started after this time. |
scaleInAvailableEndAt | scale in can be started after this time. |
notifyRoomNumMessage | notifying message by slack. |
scaleInMinimumIntervalSec | scale in can be started countinuously after this interval. |
scaleOutMinimumIntervalSec | scale out can be started countinuously after this interval. |
specifiedTimeGreenHostsNum | instance number will be change to this value between specified time. |
restartCmd | restart autoscale process commond. |
autoRestartCpuUsageThresholdForLB | if cpu usage exceed this value, process restart. |
autoRestartMonitorIntervalSec | monitoring span for auto restart. |
Correspond to D in above structure chart.
key | desc |
---|---|
monitoredHost | monitored target. |
monitoredProcess | like 'game', 'lobby' |
monitoringIntervalSec | monitoring span |
decisionIntervalSec | monitored process does not reply throughout this span, it is regard as died. |