为什么有些网站分布在 www2、www3 子域上,而其他网站则无需这些子域即可管理扩展?
我知道这与拥有各种负载平衡服务器有关,但为什么有些网站使用不同名称的“www”子域(www2.somesite.com、www3.somesite.com 等),而其他网站可能非常庞大如果不这样做 - 即所有流量都流向 www.hugesite.com。
它是否表明某些架构决策/具有特定目的? 这是可以避免的还是网站以某种方式扩展的限制?
I know it's to do with having a variety of load balancing servers, but why do some sites make use of differently named "www" sub domains (www2.somesite.com, www3.somesite.com etc) where as other can be perfectly massive without doing this - ie all traffic is to www.hugesite.com.
Does it indicate certain architectural decisions / have a specific purpose? Can it be avoided or is it a limitation of having the site scale a certain way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
www[n] 是添加更多服务器来应对负载的简单方法,因为您可以非常轻松地在各个服务器之间进行负载平衡 - 使用 www[n] 您可以将请求重定向到适当的服务器并忘记后续请求 -因为客户端然后处理 www1 或 www2 等...添加更多服务器很简单...但就后续请求而言它不是持久的。
另一种方法是负载均衡器维护一个后端节点池,这些节点在“后面”维护场景”。 它跟踪用户已分配到哪个节点 - 通常通过使用会话 cookie 来识别用户已分配到哪个后端节点。 它只是在内存中(有效地)维护一个大的会话 ID 到后端节点的哈希映射,每次将来自用户浏览器的请求委托给后端节点……设置起来更复杂,但从长远来看更强大。
更多信息请点击这里:
http://en.wikipedia.org/wiki/Load_balancing_%28computing%29
www[n] is an easy way to add more more servers to cope with load since you can load balance very easily between the various servers - with www[n] you can just redirect the request to the appropriate server and forget about subsequent requests - because the client then deals with www1 or www2 etc... Adding more servers is simple... but it's non persistent in terms of subsequent requests
The alternative is for the load balancer to maintain a pool of backend nodes that are maintained "behind the scenes". It keeps track of which node the user has been allocated to - normally by using session cookies to identify which backend node the user has been allocated to. It just maintains a big in memory hashmap (effectively) of the session id's to backend nodes, delegating requests from a user's browser to the backend node each time... it's more complex to setup, but more powerful in the long run.
More info here:
http://en.wikipedia.org/wiki/Load_balancing_%28computing%29