Nginx Ip_Hash calculation

By | December 21, 2017
Questions:

We want to use Nginx as a LoadBalancer for our servers but we are concerned with session stickyness and ip_hash calculation. If for example server backend3 were to die and connections time out would marking it as down in the config change the ip_hash calculated for sessions?

upstream backend {
  ip_hash;
  server   backend1.example.com;
  server   backend2.example.com;
  server   backend3.example.com down;
}

As far as I know ip_hash is vaguely calculated on source IP, and the number of backends it can potentially connect to. I’ve been unable to find a direct answer to this in documentation or scouring the internet. Any answer is appreciated!

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *