FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
networking 2 servers? how to?

 
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development
Author Message
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Sun May 20, 2007 11:14 pm    Post subject: networking 2 servers? how to? Reply with quote

When i was doing research on my ecommerce course, I was wondering how could we hook up two dedicated server together and make it as a load balancing?

In usual case, we only use one web server at a time, but if the server get very heavy load like Digg does, one server would not be enough. So in this case, how could we hook up two server together and use load balancing between the two?

cheers

Back to top
HarryR
first grade


Joined: 03 Apr 2007
Posts: 17
Location: United Kingdom

PostPosted: Sun May 20, 2007 11:44 pm    Post subject: Reply with quote



Hello guitarman,
You can do basic load balancing using only DNS round robin.

For example, for www.example.com you'd have two A records, 192.168.1.1 and 192.168.1.2.

Each time the web browser needs a new connection to www.example.com, it will get either one of the IP addresses (and alternate between the two for each request).

Using this you can effectively distribute the load between the two servers without any proprietary hardware or software sitting infront of them.

Alternatively you could use something like Haproxy or Pound which are software load balancers. These would sit on a separate server(s) infront of your cluster and distribute HTTP requests to different servers based on their load, the URL and any other number of factors.

Thirdly you could use something like Linux Vserver and heartbeat on 2-3 servers sitting infront of your cluster to balance TCP connections between servers in your cluster based on their load.

Generally I'd say that the first option would be your best bet, but for really heavy loads I'd be using HAproxy or Pound on a few machines with heartbeat failover.

However, with only two servers you're going to be constrained to using round robin DNS and (if you need faster failover) heartbeat too.

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Mon May 21, 2007 1:17 am    Post subject: Reply with quote

Harry, thanks!
So for first option, we only deal with DNS? i.e. to contact DNS to setup the two IPs address?

The Ips address is taken from the dedicated servers that i bought right?

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development All times are GMT + 8 Hours
Page 1 of 1



by phpBB