Question:
Why are there urls that contain some number after the www? (www1, www3, www12)
What does this influence?
Is it possible for me to create a link like this?
Ex:
Answer:
Yes, it is possible!
This is usually done by a process called balanceamento de carga
. Load balancing is basically splitting the load (ie requests from websites which in turn require some processing power and memory on a web server) across multiple web servers, rather than having um único servidor para fazer todo o trabalho
. It usually consists of a unidade central
that monitors the load of other servers, and distribui as requisições
sent to a server that has the menor carga
at the moment. www3 is one of those servers that receive web requests from the controlador central
.
For a normal website this is unnecessary unless it receives thousands of requests per second (eg Google), but for complex web applications this process keeps the web application performing well as well as increasing availability (if one of those servers fail, the rest will still be able to handle the requests).
If you want to learn more about load balancing, you can start here .
These números referem-se
to the names of servers in the load balancing pool, as each server must have a unique name. They could also have taken a different naming convention, like naming each server the name of a planet. In that case, you would see a URL like namekuseijin.goku.com.br
or planetavegeta.goku.com.br
Mas se WWW.GOOGLE.COM não tiver um www3? Então como será feito o balanceamento de carga?
There are several mechanisms that can be used to load balance; most of the larger sites use a mixture of them.
Primeiro
, most of them use a CDN ( rede de distribuição de conteúdo
Delivery rede de distribuição de conteúdo
) that hosts their content on servers spread out geographically, so that client requests can be serviced by servers nearby. In most cases CDNs are practically a necessity on websites that have a lot of media like Tumblr, Flickr, Imgur, Youtube, etc. They are not so necessary for sites that only have text content, for example.
Segundo
, if you do a DNS lookup on www.google.com (eg host www.google.com
using Linux), you will see that it gives multiple responses for the same host address:
www.google.com has address 74.125.226.81
www.google.com has address 74.125.226.80
www.google.com has address 74.125.226.83
www.google.com has address 74.125.226.84
www.google.com has address 74.125.226.82
This means that qualquer objeto
(images, videos, etc.) from www.google.com can be provided by one of these addresses; if everyone randomly receives an object from one of these addresses, então, a carga ficará balanceada entre os endereços
.