/    Sign up×
Community /Pin to ProfileBookmark

multiple server question

so I’m kinda new to web development and something has been on my mind a while now. when building a website that requires multiple servers (just because of site demand and size) how is it managed I guess? I mean, if for talks sake one server can handle 10,000 users at any given time (that number is a complete guess) and the site is averaging 20,000 users at any given time, the obvious solution is to add another server. so how does the clients web browser know which server to go to? and what if the stuff their looking for is on one server but they get redirected to the other server because the first one is busy, what happens then?

to post a comment
Full-stack Developer

17 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 10.2017 — Typically there is a "load-balancer" (L? server between the web browser and the actual web servers (WS). The domain name service will direct the browser request to the LB, which will use its algorithms to decide which WS will receive the request, and then sends it to that WS. The WS does its stuff, then outputs its response to the WS, which then does more magic ( ? ) to send it back to the requesting browser. Things can get further complicated if/when you also need to split up the database server into more than one, in which case there may be another LB just for the DB requests form the web servers.

Basic diagram: http://www.serverlab.ca/wp-content/uploads/2014/04/51-figure-02c.png

With DB balancing, too: https://itprimer.files.wordpress.com/2011/08/haarchi.jpg
Copy linkTweet thisAlerts:
@coleioauthorMay 10.2017 — thanks for the reply, ill read those links now

is it normal to have one database with several web servers?
Copy linkTweet thisAlerts:
@coleioauthorMay 10.2017 — tbh I didn't think it was possible to have one db with more than one server
Copy linkTweet thisAlerts:
@NogDogMay 11.2017 — Each web server can talk to the same DB server over the LAN if you want. Conversely, if the database is the choke point, one web sever might talk to multiple (possibly sharded) DB severs. The potential different configurations are many, and no single one is right for all situations -- plus you get into redundancies and fail-over servers in case any one (or more?) servers fail, and so forth. That second image link diagrams two load-balanced web servers sharing their requests across 4 separately load-balanced DB servers, for instance.
Copy linkTweet thisAlerts:
@coleioauthorMay 11.2017 — so does a database have a max amount ofrequests it can handle? what about a site like facebook, would that have one database with thousands of servers?
Copy linkTweet thisAlerts:
@NogDogMay 11.2017 — Facebook probably has multiple data centers across the country/world, each with dozens or even hundreds of physical servers, each physical server potentially running many virtual servers. By the time you are getting enough traffic to even have to think about more than a couple web servers and database servers, you'll be able to afford to hire an expert to expand your production deployment as needed. ?

(The specific system I work on right now gets by on two web servers and one DB server, processing over a 1000 requests per minute during peak hours.)
Copy linkTweet thisAlerts:
@coleioauthorMay 11.2017 — woah that's pretty cool. I'm taking the full suite of ciw courses

https://www.ciwcertified.com/ciw-certifications

so hopefully ill be able to manage this stuff on my own but I'm impatient. really appreciate your help though, thanks
Copy linkTweet thisAlerts:
@coleioauthorMay 11.2017 — one other thing I'm curious about is what brand machines are out there, who are "apparently" the best manufacturers and how many requests can the average server actually handle?
Copy linkTweet thisAlerts:
@NogDogMay 11.2017 — one other thing I'm curious about is what brand machines are out there, who are "apparently" the best manufacturers and how many requests can the average server actually handle?[/QUOTE]

No idea -- but I'm sure it changes every few months. ?

We're mostly migrating to Amazon AWS services now. Here's some descriptions of their options, though they don't necessarily list physical box manufacturers/models: https://aws.amazon.com/ec2/instance-types/
Copy linkTweet thisAlerts:
@coleioauthorMay 12.2017 — i think I'm a bit of a noob to understand aws, is it something like godaddy, a hosting service?
Copy linkTweet thisAlerts:
@TrainMay 12.2017 — to give a idea

https://aws.amazon.com/about-aws/global-infrastructure/

Amazon Web Services (AWS) is a subsidiary of Amazon.com that provides on-demand cloud computing platforms. These services operate from many global geographical regions including 6 in North America.[3] They include Amazon Elastic Compute Cloud, also known as "EC2", and Amazon Simple Storage Service, also known as "S3". As of 2016, AWS has more than 70 services, spanning a wide range, including compute, storage, networking, database, analytics, application services, deployment, management, mobile, developer tools and tools for the Internet of Things. Amazon markets AWS as a service to provide large computing capacity quicker and cheaper than a client company building an actual physical server farm.[4]

https://en.wikipedia.org/wiki/Amazon_Web_Services
Copy linkTweet thisAlerts:
@coleioauthorMay 12.2017 — I presume hosting is one of those products? I'm not sure what cloud computing is, but its on my to do list and theres actually a segment in the course I'm doing for cloud computing
Copy linkTweet thisAlerts:
@NogDogMay 12.2017 — It's a little like GoDaddy and other such services, but gives the user more flexibility on how each virtual server is configured, along with the ability to spin up new (virtual) servers as you need them. Instead of having to fill out a form and pay to get the additional servers you need, then wait for them to be set up; you instead have a billable account that lets you essentially bring them on-line as and when you need them, configure the way you want -- and in a matter of minutes it's ready for use. Of course, it all then gets automatically added to your billing account.

Microsoft provides a similar service, and I think maybe Google does, too?
Copy linkTweet thisAlerts:
@coleioauthorMay 12.2017 — that sounds like exactly what I'm looking for, I'm planning a site (wont go into the details now) but it could reach 5million members over the course of 2 oe 3 years so easily scaling is a must

thanks lads
Copy linkTweet thisAlerts:
@TrainMay 12.2017 — Google cloud

https://cloud.google.com/

Same sort of thing.

Seen others advertised.
Copy linkTweet thisAlerts:
@coleioauthorMay 13.2017 — i read up on the loud and all its awesomness last night, thanks for pointing me in the right direction

nogdog when you referred to a load balancer did you mean one of these?

https://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=load+balancer
Copy linkTweet thisAlerts:
@coleioauthorMay 16.2017 — bump
×

Success!

Help @coleio spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...