Multi server website

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?

9 Replies

@Drakling:

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.

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?

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).

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.

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.

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.

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.

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?

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/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct