nginx (load balancing algorithm)

1, the load balancing algorithm Nginx
1) Polling (default)
each request individually assigned to different chronological order back-end services, if a backend server is down, the failed host automatically removed, so that the user access is not affected.
2) weight (polling weight)
weight value, the higher the probability of access, mainly used for each back-end server performance unbalanced situation. Or just to set different weights in the case of a master-slave achieve rational and efficient use of host resources.
3) ip_hash
each access request in accordance with the allocation of IP hash result, the visitors from the same IP fixed access a back-end servers, and can effectively solve the problem of dynamic shared session page.
4) fair
than the weight, ip_hash more intelligent load balancing algorithms, fair algorithm can be carried out according to the page size and load duration of intelligent load balancing, which is based on an allocation request to the backend server response time, short response time priority allocation. nginx does not support fair, if this scheduling algorithm needs, you must install upstream_fair module.

5) url_hash
according hash result to access url allocation request, each url directed to a back-end servers, back-end can further improve the efficiency of the cache server. nginx does not support url_hash, if you need this scheduling algorithm, you must install nginx packages of hash.

Original: Big Box  nginx (load balancing algorithm)


Guess you like

Origin www.cnblogs.com/petewell/p/11615139.html