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.

  1. Hook into the load balancer's health monitor
  2. If the load goes over 70% launch a new ec2 instance
  3. 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

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

That's really cool! What

That's really cool! What site are you using this on, can you share the script?

Would you mind posting

Would you mind posting samples of the scripts? I am sure that others (like me) would find them useful.

Thanks!

where is your load balancer

where is your load balancer in this scenario? another EC2 box? or did you rent/host a hardware load balancer somewhere nearby?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.