负载均衡器减慢了站点速度

发布于 2024-12-16 13:01:53 字数 578 浏览 2 评论 0原文

我们有 6 台 Web 服务器和中间的负载均衡器。

但负载平衡似乎实际上减慢了速度。如果我使用任何服务器的 IP 地址访问该站点,与通过负载均衡器访问相比,该站点的打开速度会更快。

在负载均衡器上,请求似乎需要等待很长时间才能得到其他请求的响应,尤其是对于 JS 代码。不过,负载均衡器配置了会话关联性。 有时甚至会出现重定向循环。在某些网络上,根本没有响应,导致网站崩溃。

有什么我需要遵循的提示吗?如何知道负载均衡器是否已配置并正常工作?

负载均衡器位于 apache 上,站点是使用 PHP 构建的。

更新: 负载均衡是通过LVS来完成的,采用的算法是Round-Robin调度。 我不确定还需要什么其他详细信息,但问题是,当我使用任何一台服务器的 IP 地址直接访问该站点时,它运行良好且速度相当快,但是,当我使用负载均衡器 IP 地址时,某些资源(例如 css/图像根本无法加载,并且网站会长时间加载,然后最终失败。 我尝试了所有服务器的所有 IP 地址,一切正常,似乎 LB 有问题,只是不知道如何知道。如果我再次错过任何重要信息,请告诉我以准确了解问题。

非常感谢任何帮助。

谢谢

We have 6 web servers and a load balancer in between.

But load balancing seems to actually slowing down the things. If I access the site using any server's IP address the site gets opened fast compared to accessing through load balancer.

On load balancer it seems requests wait for long till they get response from other requests, especially for JS code. Load balancer is configured with session affinity though.
Some times there are even redirect loops. On certain networks the response doesn't come at all leaving the site broken.

Are there any tips that I need to follow. How to know if load balancer is configured and working properly?

Load balancer is on apache and site is built using PHP.

UPDATE:
Load balancing is done through LVS and the algorithm used is Round-Robin scheduling.
I am not sure what other details are required, but the problem is, when I access the site directly using any one server's IP address, it comes fine and pretty fast, but, when I use load balancer IP address, some resources like css/images don't load at all and site keeps loading for long time and then eventually fails.
I tried with all IP addresses of all servers and all work fine, seems like there is a problem with LB, just not sure how to know. Let me know if I am missing any crucial info again to know the problem exactly.

Any help is greatly appreciated.

Thanks

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

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

发布评论

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

评论(1

我一向站在原地 2024-12-23 13:01:53

我想我在这里找到了原因。

与负载均衡器无关。我对域名服务器执行 ping 操作,发现许多数据包丢失了。

现在增加了 ttl,希望它能解决问题,否则将拥有自己的名称服务器。

谢谢

I guess I found out the reason here.

It is nothing to do with load balancer. I pinged the nameservers and found out many packets were getting lost.

Now have increased the ttl, hoping it will resolve the issue else going to have own nameservers.

Thanks

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