AWS Auto Scaling Cluster

So, I'm changing a lot of live updates on my sites (currently working on AJAX) to use Websockets. Tried Pusher.com, the price is ridiculously high for my amount of traffic, so I got a slanger (hello Steve!) On a large fat EC2 instance, redis EC instance, all is well. Now around 100M frames / day everything seems to be working fine, but I would like to think ahead and think about what will happen when I have even more traffic.

AWS ELBs don't support WS communication as I've read here and on the AWS forums so far (pretty lame considering people ask for this since WS first came out, thanks AWS!). So I think:

0) start with a single instance, ws.mydomain.com

1) set up autoscale group

2) cloud facility warning on average cpu / memory usage

3) when it exceeds 75%, the SQS message will light up, which says something like "scale now"

4) when a message at # 3 is received by some other random server by polling the queue, then start a new instance, add it to the group (ohnoes, this AWS API again!) And add the public IP to DNS Route53 for ws.mydomain .com, so there will be 2 of them

5), when another message crashes while loading, basically everything is done the other way around.

So the question is, could this work, or would it be easier for it to go with the ELB in front of the slanger nodes?

TIA

Next, edit:

1) it doesn't matter if we don't get the client's IP address

2) slanger docs advertise that connection states are stored in redis, so it doesn't matter which node the clients connect to, so we don't need the session identity

+3


source to share





All Articles