I have a basic PHP / MySQL website stored entirely on an Amazon EC2 micro instance. Traffic is about to increase for a temporary period, and I would like to implement basic auto-scaling mainly to give me more CPU power since that seems to be the bottleneck. So the main constraints I know I have are:
Can anyone point to the best way to do this?
P.S. Because my server setup is not that complex, I am willing to rebuild / re-upload all of it if I have to.. I just need to get the Auto Scaling in place correctly.
I had a similar problem and here's what I did.
Prepare the App server to be auto-scalable (able to run on multiple instances simultaneously):
I tested this instance to make sure my app-server is totally separate from my DB and other write Storage. When it's all set:
git pull origin master
from the repository (to make sure the code on the new instances will always be the latest);Now that the Auto-scaler is all set:
Take note: DON'T use the static IP address assigned to your Load Balancer because they will change very frequently. You really need to setup a CNAME pointing to the Load-Balancer end-point.
Some maintenance that I needed to do:
And BTW, I'm using T1.micro
instance. That's the whole idea of using Auto-scaling in the first place. We don't want to be spending on a Medium server all the time our app is on a slack.