# Ip\_hash detailed behaviour

**URL:** <https://www.ruby-forum.com/t/ip-hash-detailed-behaviour/237488>\
**Category:** NGINX\
**Created:** [November 15, 2013, 6:14pm UTC](https://www.ruby-forum.com/t/ip-hash-detailed-behaviour/237488 "2013-11-15T18:14:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [November 15, 2013, 6:14pm UTC](https://www.ruby-forum.com/t/ip-hash-detailed-behaviour/237488/1 "2013-11-15T18:14:59Z")

</div>

Hello

I would like to know more about the behaviour of ip\_hash when NGINX is  
reloaded and in the scenario of removing an upstream node.

Is ip\_hash somehow clever/sticky and would reasign the IPs to the same  
node  
after a reload or restart? and what would happen if an upstream node is  
marked/flagged as down.

I’m not sure if this is the correct list or i should write to nginx-dev.

Regards

M

---

<div class="post-metadata">

**Author:** ![Martin\_Loy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c37758/32.png) [@Martin\_Loy](https://www.ruby-forum.com/u/Martin_Loy)\
**Post date:** [November 15, 2013, 6:35pm UTC](https://www.ruby-forum.com/t/ip-hash-detailed-behaviour/237488/2 "2013-11-15T18:35:26Z")

</div>

Hello!

On Fri, Nov 15, 2013 at 03:13:44PM -0200, Martin Loy wrote:

> Hello
> 
> I would like to know more about the behaviour of ip\_hash when NGINX is  
> reloaded and in the scenario of removing an upstream node.
> 
> Is ip\_hash somehow clever/sticky and would reasign the IPs to the same node  
> after a reload or restart?

The ip\_hash just uses a hash function to distribute clients among  
configured upstream servers. If a number of upstream servers  
changes, the distribution changes as well.

> and what would happen if an upstream node is  
> marked/flagged as down.

In this case clients which are normally passed to the server  
marked down will be distributed between other servers.

See [http://nginx.org/r/ip\_hash](http://nginx.org/r/ip_hash) for more details.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)
