Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created February 24, 2014 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/9187108 to your computer and use it in GitHub Desktop.
Save jsierles/9187108 to your computer and use it in GitHub Desktop.
Requests are distributed according to the servers in round-robin manner with respect of the server weight.
For example of every seven requests given above they will be distributed like this: 5 requests on backend1.example.com and one request to the second and the third of server. If with an attempt at the work with the server error occurred, then the request will be transmitted to the following server and then until all workers of server not are tested. If successful answer is not succeeded in obtaining from all servers, then to client will be returned the result of work with the last server.
Nginx distributes requests round-robin, factoring in the server weight value.
For example, for a total of 7 requests, the distribution is: 5 requests to backend1.example.com, and one request each to the other two servers. If the server returns an error, nginx will retry the request on the next server in the list. Should all servers return errors, the client receives the response from the last server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment