加载中 ...
首页 > 新闻资讯 > 小程序 正文

负载均衡策路

2019-07-12 23:24:19 来源:沈阳小程序开发 作者:沈阳软件开发

在实际应用中,用户可能不想仅仅是把客户端的服务请求平均地分配给内部服务器,而不管服务器是否宕机。而是想使Pentium I服务器比Pentium II i能接受更多的服务请求,一台处理服务请求较少的服务器能分配到更多的服务请求,出现故障的服务器将不再接受服务请求直至故障恢复等。

在实际应用中,用户可能不想仅仅是把客户端的服务请求平均地分配给内部服务器,而不管服务器是否宕机。而是想使PentiumI服务器比的PentiumIII能接受更多的服务请求,一台处理服务请求较少的服务器能分配到更多的服务请求,出现故障的服务器将不再接受服务请求直至故障恢复等。选择合适的负载均衡策略,将能使多个设备很好的共同完成任务,消除或避免现有网络负载分布不均,数据流量拥挤反应时间长的瓶颈在各负载均衡方式中,针对不同的应用需求,在OSI参考模型的第二,三,四,七沈阳软件制作

ad.jpg

XX 层负载均衡具有相应的负载均衡策略。负载均衡策略的优缺点及其实现难度有两个关键因素。一种是负载均衡算法,另一种是网络系统状态的检测方法和能力。1-1PI0201522554.png考虑到不同类型的服务请求,服务器的不同处理能力以及随机选择导致的负载分配不均,为了更加合理地将负载分配给多个内部服务器,应用程序需要正确反映每个服务器。用于处理能力和网络状态的负载平衡算法:(1)循环:来自网络的每个请求依次分配给内部服务器,从1到N然后重新启动。此均衡算法适用于服务器组中的所有服务器具有相同硬件和软件配置且平均服务请求相对平衡的情况。 (2)加权循环:根据服务器的不同处理能力,为每个服务器分配不同的权重,使其能够接受相应权重的服务请求。例如,服务器A的权重设计为1,B的权重为3,C的权重为6,则服务器A,B和C将分别接收10%,30%和60%的服务请求。此均衡算法可确保高性能服务器获得更多使用并避免低性能服务器过载。 ◆随机均衡(随机):将来自网络的请求随机分配给内部的多个服务器。加权随机:此均衡算法类似于权重循环算法,但它是处理请求共享时随机选择的过程。 (3) Response speed equalization (ResponseTime): The load balancing device sends a probe request (such as Ping) to each internal server, and then determines which server responds to the client according to the fastest response time of each server in the internal probe request. Request for service. This equalization algorithm can better reflect the current running state of the server, but the fastest response time only refers to the fastest response time between the load balancing device and the server, rather than the fastest response time between the client and the server. (4) Least Connection Balance (LeastConnection): Each time the client requests the service to stay on the server, there may be a large difference. As the working time is longer, if a simple round robin or random equalization algorithm is used, each The connection process on the server can be very different and does not achieve true load balancing. The minimum connection number equalization algorithm has a data record for each server that needs to be loaded internally, and records the number of connections currently being processed by the server. When there is a new service connection request, the current request is assigned to the least number of connections. The server makes the balance more realistic and the load is more balanced. This equalization algorithm is suitable for long-term processing of request services, such as FTP. (5) Processing capacity equalization: This equalization algorithm will allocate the service request to the internal processing load (converted according to the server CPU model, CPU number, memory size and current connection number), the lightest server, considering the internal The processing power of the server and the current network operating conditions, so this equalization algorithm is relatively more accurate, especially suitable for the seventh layer (application layer) load balancing. 微信小程序 response time. This mode is generally used in the HrP server group. The block virtual network adapter is installed on each server, and its IP address is set as the VIP of the server group, so that the server can successfully reach the three-way handshake when responding directly to the client request.xx

“沈阳软件公司”的新闻页面文章、图片、音频、视频等稿件均为自媒体人、第三方机构发布或转载。如稿件涉及版权等问题,请与

我们联系删除或处理,客服QQ:55506560,稿件内容仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同

其观点或证实其内容的真实性。