主权项 |
1. A method for balancing subsets of backend servers, the method comprising:
assigning, using a network controller, an index number to each backend server in a set of backend servers; allocating, for each of a plurality of frontend servers, a respective subset of the set of backend servers based on a random shuffling of the index numbers assigned to the backend servers, wherein the allocating includes:
determining a subset size that is a desired number of backend servers in a subset, dividing the plurality of frontend servers into rounds, each round having a number of frontend servers less than or equal to a number of backend servers in the set of backend servers divided by the subset size, andfor each round, generating a shuffled ordering of the index numbers for the set of backend servers and deterministically assigning each frontend server in the round to a respective subset of backend servers using the shuffled ordering; determining that a size of a first subset of backend servers differs from a size of a second subset of backend servers; and transferring a backend server in the first subset of backend servers to the second subset of backend servers. |