网站分区和 URL 空间

发布于 2024-07-14 22:56:00 字数 235 浏览 7 评论 0原文

我的网站正在增长。 我需要将功能集分区到不同的服务器组,而不是让所有功能在单个服务器副本上运行。 我的 Windows 网络负载平衡设置中有 8 台相同的服务器。

问题是:我需要保持 URL 空间相同。 什么是可行的解决方案? 我不想为功能集启动新域。 我正在考虑某种具有基于 URL 重写/路由功能的反向代理(?!?)。 在软件或硬件方面有什么建议吗? 这将取代 WNLB 设置,因为它不具备我需要的功能。

My website is growing. I need to partition feature sets to different group of servers instead of having all features run on a single server copy. I have 8 identical servers in a Windows Network Load Balancing setup.

The problem is: I need to keep the URL space the same. What would be a workable solution? I don't want to start new domains for the feature sets. I am thinking some kind of reverse proxy with some URL based rewriting/routing capabilities(?!?). Any recommendations in terms of software or hardware? This is going to replace the WNLB setup as it does not have the capabilities I need.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云裳 2024-07-21 22:56:00

确实有几种解决方案可以实现负载平衡:

  1. DNS 循环
  2. DNS 负载平衡(使用 lbnamed)
  3. 代理循环
  4. 硬件/TCP 循环

我理解 1) 和 2) 在这里不是一个选项,所以...如果您有金钱和非常高的性能需求,选择 4)。 否则,执行 3)。

对于代理循环,同样有几种可能的解决方案: Apache mod_rewrite, Apache mod_proxy, Squid (当然还有许多其他我不知道的)。

  • 对于“哑”负载平衡,Apache mod_rewrite 中有一个示例 URL 重写指南(请参阅代理吞吐量循环部分)。

  • Apache mod_proxy 可以充当代理将客户端连接到互联网,但通常用作反向代理将 URL 重定向到另一台服务器。 它没有缓存功能(但可以与 mod_cache 和 mod_rewrite 一起使用...)。

  • Squid 是一个代理缓存,通常用于将客户端连接到互联网。 但它也可以用作反向代理,并配置为缓存请求并加速内容交付。

如您所见,选择其中之一取决于您想要代理的内容和方式。 就您而言,如果您想在 Linux 上进行缓存(如果可以的话),我会考虑运行 Apache mod_proxy 或 Squid。

关于硬件,我不是专家,但我认为“小型”到“中型”专用服务器应该足够了。 只是不要忘记所有请求都将通过这台机器,因此它的大小很大程度上取决于您的流量,这看起来不错。 这可能需要对现实生活中的数据进行一些挖掘。

There are indeed several solutions to implement load balancing:

  1. DNS Round-Robin
  2. DNS Load Balancing (with lbnamed)
  3. Proxy Round-Robin
  4. Hardware/TCP Round-Robin

I understood 1) and 2) are not an option here so... if you have money and really high performance needs, go for 4). Else, go for 3).

For Proxy Round-Robin, again, several solutions are possible: Apache mod_rewrite, Apache mod_proxy, Squid (and surely many others I don't know).

  • For "dumb" load balacing, there is an example in Apache mod_rewrite's URL Rewriting Guide (see Proxy Throughput Round-Robin section).

  • Apache mod_proxy can act as proxy to connect clients to the internet but is usually used as reverse proxy to redirect an url to another server. It has no cache functionality (but can be used with mod_cache, and mod_rewrite...).

  • Squid is a proxy cache and is usually used to connect clients to the internet. But it can also be used as reverse proxy and be configured to cache the requests and to accelerate content delivery.

As you can see, choosing one of them depends on what and how you want to proxy. In your case, I would consider running Apache mod_proxy or Squid if you want caching on Linux (if it is an option).

Regarding the hardware, I'm not a specialist but I think a "small" to "medium" dedicated server should be enough. Just don't forget all the requests will go through this machine so its sizing highly depends on your traffic which seems decent. This might require some digging with real life data.

情释 2024-07-21 22:56:00

如果您有 8 台服务器,我建议使用其中 7 台来分担工作负载,并使用一台前端服务器充当代理。

您的前端服务器可以运行 Apache 并使用 mod_proxy 将每个 HTTP 请求委托给 7 个后端服务器之一。 如果需要,您可以设置 mod_proxy 根据传入 URL 委派工作,例如,您可以让一台服务器提供视频,两个服务器提供博客条目,其余服务器则执行其他操作。

您的前端服务器将非常轻:运行 Apache,仅运行其他内容。 您还可以使用 Squid 或 Apache 的 mod_cache 将静态内容缓存在此前端服务器上,这样,对图像、js、css 和其他静态内容的请求一旦被缓存,就永远不会到达您的后端 7 服务器。

编辑:我刚刚读了帕斯卡的评论,他提出了同样的建议。 我会修改他+1

If you have 8 servers I would suggest using 7 of them to share the work load and using one front-end server to act as a proxy.

Your front end server could run Apache and use mod_proxy to delegate each HTTP request to one of the 7 back-end servers. You can set mod_proxy to delegate the work based on the incoming URL if you need to so you could, for example, have one server serving video, two serving blogs entries and the rest doing whatever else.

Your front-end server would be extremely light: running Apache and little else. You could also cache your static content on this front server using Squid or Apache's mod_cache so that requests for images, js, css and other static content will never hit your back end 7 server once it has been cached.

EDIT: I just went a read Pascal's comment and he's suggesting the same thing. I'll mod him +1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文