There under linux Nginx, LVS, Haproxy services and so can provide load balancing services, and Nginx provides several distribution (strategy):
1, the polling (default)
each request individually assigned to a different time order back-end server, if the back-end server is down, can be automatically removed.
2, weight representation, a default weight, the higher the weight customers allocated more ends, as follows;
upstream server_pool{
server 127.0.0.1:8081 weight=2;
server 127.0.0.1:8082 weight=1;
}
3, ip_hash
each request assigned by hash result Access ip so that each visitor to access a fixed back-end server, can solve the problem of session. E.g:
upstream server_pool{ ip_hash; server 127.0.0.1:8081; server 127.0.0.1:8082; }
4, fair (third party) by the response time of the allocation request to the backend server, the response time is short preferentially allocated
upstream server_pool{ server 127.0.0.1:8081;; server 127.0.0.1:8082; fair; }