7
Dec
0
Scaling up with Rails and EC2
A challenge I faced recently was "scaling up on demand" (without manual intervention). EC2 was the my platform of choice because I could write a small script to manage all my machines. EC2 being Xen based also allowed me to create custom images of my application servers.
- Hook into the load balancer's health monitor
- If the load goes over 70% launch a new ec2 instance
- If the load goes under 50% remove an instance
Example:
- @ 7am - 2 servers
- @ 1pm - 4 servers
- @ 6 pm - 3 servers
- @ 9 pm - 2 servers
I have a base of 2 machines, and no real limit set to the maximum number of ec2 machines that can launched. The script is set to send me a mail every time a new machine is launched or terminated.
Now I am trying to automate creation of MySQL Slaves










