简体   繁体   English

负载平衡器使站点变慢

[英]Load balancer slowing down the site

We have 6 web servers and a load balancer in between. 我们之间有6台Web服务器和一个负载均衡器。

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. 如果我使用任何服务器的IP地址访问该站点,则与通过负载均衡器访问相比,该站点的打开速度更快。

On load balancer it seems requests wait for long till they get response from other requests, especially for JS code. 在负载平衡器上,请求似乎要等待很长时间才能获得其他请求的响应,尤其是对于JS代码。 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. 负载平衡器位于apache上,站点是使用PHP构建的。

UPDATE : Load balancing is done through LVS and the algorithm used is Round-Robin scheduling. 更新 :负载平衡是通过LVS完成的,使用的算法是循环调度。 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. 我不确定还需要其他哪些详细信息,但是问题是,当我使用任何一台服务器的IP地址直接访问该站点时,它运行起来非常好而且非常快,但是,当我使用负载平衡器IP地址时,某些资源(如CSS /图像根本无法加载,站点会长时间加载,然后最终失败。 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. 我尝试使用所有服务器的所有IP地址,并且一切正常,似乎LB存在问题,只是不确定如何知道。 Let me know if I am missing any crucial info again to know the problem exactly. 让我知道我是否再次丢失任何重要信息以准确了解问题。

Any help is greatly appreciated. 任何帮助是极大的赞赏。

Thanks 谢谢

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. 我对名称服务器执行ping操作,发现许多数据包丢失了。

Now have increased the ttl, hoping it will resolve the issue else going to have own nameservers. 现在增加了ttl,希望它将解决该问题,否则将拥有自己的名称服务器。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM