Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Multi server website
PostPosted: Sun Jan 03, 2010 9:26 pm 
Offline
Senior Newbie

Joined: Sun Jan 03, 2010 9:04 pm
Posts: 8
Hello Linoders. I have a question for those of you with knowledge in this area. I'm sure that websites with large traffic like YouTube, Myspace, etc., can't be handled by just one server. Certainly they have multiple servers handling the website traffic, directing users to the server with the least load on it at the time.

How could I optimize a large traffic website to do something like that to have a website work across multiple VPS's?


Top
   
 Post subject: Re: Multi server website
PostPosted: Sun Jan 03, 2010 11:47 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
Drakling wrote:
Hello Linoders. I have a question for those of you with knowledge in this area. I'm sure that websites with large traffic like YouTube, Myspace, etc., can't be handled by just one server. Certainly they have multiple servers handling the website traffic, directing users to the server with the least load on it at the time.

How could I optimize a large traffic website to do something like that to have a website work across multiple VPS's?


True load balancing (load based) is best done with specialized hardware. There is likely little reason to use multiple VPS's in that case, instead just go up to a higher level.


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 12:54 am 
Offline
Senior Newbie

Joined: Sun Jan 03, 2010 9:04 pm
Posts: 8
Okay, but then that brings me to the question of network stability. Say you want to have a VPS located in a few different locations. That way when one location goes down, the others will serve any hits. Is something like that possible to do and how would you set a domain up to perform any sort of routing like that?


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 2:27 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Exactly how "large" are you talking about?

Your example sites don't just use multiple servers, they use very large server farms.

VPS's are amazing examples of technology, but there's a point when sharing a physical box (which you don't have control of) with numerous neighbors (which you don't have control of) is a BAD idea.

That said, assuming you meant "larger then your typical personal/small organization blog" type large - then just split your Web engine from your database (i.e one VPS for Apache/Nginx and one VPS for your DB engine).


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 4:15 am 
Offline
Senior Newbie

Joined: Sun Jan 03, 2010 9:04 pm
Posts: 8
Large enough to require more than just one server especially for redundancy, but small enough that a few strategically located VPS plans could handle. That said, I'm looking to accommodate 5,000+ users hourly, with many database queries as well, as my website is 100% database driven.

I guess I didn't communicate my need clearly enough to be understandable. It's not so much that I require more than one VPS to balance the load, which would be nice to be able to do it. My website's traffic comes from all over the world. Many have slow load times due to large distance from the server. I want to be able to route them to the quickest server for them at the instant they enter in my website's domain. Also, should for any reason, a network issue arise or a server crash, or if the server is getting too much traffic to handle, I'd like for another server to kick in and serve the webpages to any new incoming traffic as a backup until the primary server of that location is able to handle more traffic again. It's all about redundancy and availability.


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 6:31 am 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
Hi,

I never tried and I don't know the reliability of the service, but http://www.postpart.com has what you want in a simple way.


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 8:02 am 
Offline
Senior Member

Joined: Sun Aug 02, 2009 1:32 pm
Posts: 222
Website: https://www.barkerjr.net
Location: Connecticut, USA
If you just place two A-records in your DNS, one for each server, web browsers will failover to the one that's up. It will be very slow, though, because the browser will wait 60 seconds before giving up. To eliminate this delay, you'll want a low TTL (say 5 minutes) on your DNS, and to remove the down server's record ASAP.


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 9:24 am 
Offline
Senior Member

Joined: Fri Jun 13, 2008 4:11 pm
Posts: 65
Website: http://www.skafari.com
So...I've seen a few of these posts so I'll hopefully lay out something here that can be used by a few people. I'm sure some other people may have different ideas but this is how I would go about scaling.

First
We need to get DNS setup as this is the cornerstone to any properly functioning website. You'll want something with failover and anycast so go with DNSMadeEasy (http://www.dnsmadeeasy.com) or if you have the money to spend check out Dynect (http://www.dynect.com). Set TTLs low on your main record and your www record (60 seconds).

Second
CDN Time. If you are planning on a lot of hits where users may be loading the same images/media/content over and over then this should definitely be off loaded to a CDN. Not only will it save you processing on your nodes/servers it will speed up the end users loading time (or should). You don't need hundreds of dollars to use a CDN as Softlayer resells Internap's CDN (which you can use as a caching CDN) at a pay as you go price (http://www.softlayer.com/cloudlayer_cdn.html), there are other companies who are reselling various CDNs. I believe www.vps.net resells highwinds, gogrid resells cachenetworks, etc.

The Setup
I prefer setting up DNS to do a round-robin/fail over approach with two application servers sitting at the front. This way you don't just have one server consuming space/power/money just in case of a fail over. These both have private ips along with your database server(s). On your app servers put whatever web front end things you need on them and anything that can help you use memory caching, if you can use memcached to limit database queries then more power to you.

Backups
Backup early and often, don't just trust linode's or anyone elses backups for that matter. And backups don't count if they are sitting on the same server or even in the same data center or using the same provider. Backups should be held offsite away from your primary provider.

If you do things properly there are many advantages to using a cloud/vps provider over using dedicated hardware.


Top
   
 Post subject:
PostPosted: Mon Jan 04, 2010 8:50 pm 
Offline
Senior Newbie

Joined: Sun Jan 03, 2010 9:04 pm
Posts: 8
Thank you everyone, and ohkus thank you for the detailed information. I like the things that you've mentioned ohkus, so is there any chance that you might be able to provide or point me to a tutorial that would show how these things can be done?


Top
   
 Post subject:
PostPosted: Tue Jan 05, 2010 10:00 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Maybe these? (I haven't read them so can't offer a recommendation.)
http://www.informit.com/title/067232699X
http://www.informit.com/title/0137030428
http://oreilly.com/catalog/9780596102357/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group