Home  >  Article  >  Backend Development  >  Several common software load balancing algorithms.

Several common software load balancing algorithms.

WBOY
WBOYOriginal
2016-08-08 09:21:461406browse

The main load balancing algorithms are all used in nginx. The following article introduces these algorithms in more detail, please refer to it.

http://baidutech.blog.51cto.com/4114344/1033718

The article mentioned several common software load balancing algorithms, average distribution (polling), weighted polling; ip hash; Fair (minimum load balancing) needs to be mentioned here. The author once saw a colleague analyze that using this minimum load balancing algorithm may produce jitter due to machine reporting delays. At the same time, the "" strategy was also mentioned above It has strong adaptability, but the actual network environment is often not that simple, so use it with caution. "; universal hash, consistent hash (more convenient for expansion); random allocation.

One of my colleagues uses a weighted random load balancing algorithm: the idle rate of each machine [0.01,1) 1 - actual request amount/machine load capacity; then the idle rate of all machines Add the rate to S and randomly generate a number R of [0.01,1); get D=S*R; subtract the idle rate of each machine from D until D

In addition to nginx, there are two commonly used load balancing software LVS and HAProxy

For a summary of the transit modes used by the three software, please see the article:

http://blog.csdn.net/wuqingaixue /article/details/46712105#

For the advantages and disadvantages of the three load balancing software, please see the article:

Detailed explanation of the advantages and disadvantages of Nginx/LVS/HAProxy load balancing softwarehttp: //www.ha97.com/5646.html

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above introduces several common software load balancing algorithms. , including relevant content, I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn