Welcome! Log In Create A New Profile

Advanced

Re: Newbie question on ip_hash

Maxim Dounin
February 06, 2013 11:48AM
Hello!

On Tue, Feb 05, 2013 at 10:38:35AM -0500, WBrown@e1b.org wrote:

> Why does ip_hash only use the first 3 octects of the IP address?
>
> The reason I ask is that we run we servers for a number of schools. Each
> school is going the be their own subnet, ranging from a /24 to a /20 in
> size. Since ip_hash will lump everyone from a /24 in the same hash, it
> will direct them to the same server, correct?

Yes.

The ip_hash balancing was designed to work with internet services,
and use of /24 networks allows it to keep users from migrating
between backend servers as they get new IP address on
reconnect/reboot (typically from the same /24 network, at least at
the time ip_hash was introduced) while still providing good
distribution between backend servers. This probably isn't very
useful nowadays, but this is how it works.

> If I am correct above, is there any way to create persistent connections
> based on the full IPv4 address?

There is a number of 3rd party modules available which do hash
calculation based on arbitrary variables, and these may be used if
you need a hash based on full client's IPv4 address (there is
$remote_addr variable).

--
Maxim Dounin
http://nginx.com/support.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Newbie question on ip_hash

Anonymous User February 05, 2013 10:40AM

Re: Newbie question on ip_hash

Maxim Dounin February 06, 2013 11:48AM

Re: Newbie question on ip_hash

w.b February 06, 2013 12:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready