Selection of server in upstream directive using hash

Ruben rdocter at gmail.com
Mon Oct 9 07:33:55 UTC 2017


I was wondering what the selection algorithm is for choosing a server in
the upstream directive using hash. Is the selection based on the ip of the
server or is it based on the position of the list.

So if I have for example the following configuration:

upstream test {
  hash $arg_test;
  server 10.0.0.10;
  server 10.0.0.9;
  server 10.0.0.8;
}

or (ip's in different order)

upstream chat {
  hash $arg_test;
  server 10.0.0.8;
  server 10.0.0.9;
  server 10.0.0.10;
}

If someone is targeting an url with ?test=1, is it in both configs directed
to the same ip or not. So is the selection based on the ip or based omn the
position in the list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20171009/647ef4c4/attachment.html>


More information about the nginx mailing list