-1

I have an Amazon EC2 server running Apache (with WP on top). Currently, I'm running a t1.micro instance - great for now, but I've heard that it's not good if you have a bunch of traffic - Amazon limits the CPU to short little bursts, making the site unusable while a search engine is crawling it.

I believe that at some point I would want to be able to split traffic between two instances - preferably half-and-half between two or three servers. However, the more I think about it, the less I see how to do it. There would need to be data synced between the servers - mySQL, folders, etc. Also, I'm using Godaddy for my domain, and it allows me to point to one IP - I don't see an option to point to two IP's and share the load.

So, my question: Using Apache, EC2 and Godaddy, how do I route traffic equally between two instances? I think I can handle data sync.

user9517
  • 115,471
  • 20
  • 215
  • 297
Undo
  • 311
  • 6
  • 19

2 Answers2

3

While adding a second IP will allow subsequent DNS queries to rotate between the two IP addresses, most clients are behind resolvers and DNS caching servers which can have adverse effects on the natural round-robin of having more than one DNS record. This also opens you up to resolution issues should you need to change IPs sporadically or bring an instance down for maintenance.

AWS provides an Elastic Load Balancer service. You would point your primary record to the load balancer, which would route based on your configuration between multiple (even more than 2, should you require it) instances and allowing you to scale. It will also add the ability to retire instances for maintenance, either temporarily or permanently.

https://aws.amazon.com/elasticloadbalancing/

Andrew Ty.
  • 281
  • 2
  • 5
2

This is where load balancers come in.

Look into AWS's ELB service.

You would point your domain name to the ELB's IP, and ELB would take care of distributing requests to your backend servers, and also taking backend servers out of rotation if they appear to be down or unhealthy.

Maintaining state and deploying your application to your backend servers is another topic altogether.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • You're right too, but but the other answer is also correct. I hope you don't miss the fifteen rep :) I've upvoted both of you. – Undo Apr 18 '13 at 02:16