Load balancing web servers

I know next to nothing about load balancing web servers.
I am trying to distribute load of a web app across multiple servers in multiple locations.

Because of the nature of the web app it has to be on a dedicated server (or virtual instance).
It can't be on shared hosting.

My thought is to have one central web server on Amazon EC2 that does nothing but load balancing and then sends the request to one of the multiple servers.

I can't afford to have all the servers at Amazon so I am trying to take advantage of multiple office locations where I can host the web servers at minimal cost.  All web servers would contain same information sync'd up nightly so it wouldn't matter which server a user was directed to.

Does this sound like a potential solution?
If not, can someone suggest a better alternative that would still be cost effective.


Who is Participating?
JelcinConnect With a Mentor Commented:

i once tried to configure a simple webserver loadbalancing...
Have a look on this page... Maybe it is what you are looking for...

shalomcConnect With a Mentor CTOCommented:
this is great idea.
You can't use the Amazon load balancer because your servers are not in EC2. so you will we using a software LB like Apache httpd, or nginx or HAproxy (there are also other open source and lots of commercial ).
I used apache and HAProxy and both are solid solutions.

Another option is to use DNS round robin. A simple DNS round robin setup can probably be had at your current DNS service for free.
A more complex DNS load balancer, with weights and geolocation, and with a heartbeat test, is provided as a service by companies like UltraDNS. I used  their service in a previous incarnation and they are expensive but do deliver.

Costs for our server in amazon include cpu costs and traffic costs. Storage cost is negligent in your case, unless you decide to store the http logs.

You will pay for traffic 2X the amount coming into the web site and going out of it.
Depending on your site's popularity, you may need a server with lots of memory which also can be pretty costly.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.