An hashing load-balancer for nginx
C PHP Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 8 commits ahead, 11 commits behind evanmiller:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
t
CHANGES
CREDITS
README
config
nginx.patch
ngx_http_upstream_hash_module.c

README

== ngx_http_upstream_hash_module ==

Installation:

    cd nginx-1.1.4 # or whatever
    patch -p1 < /path/to/this/directory/nginx.patch
    ./configure --add-module=/path/to/this/directory
    make
    make install

Usage:

    upstream backend {
        ...
        hash        $request_uri;
        hash_again  10;          # default 0
    }

Works the same on 32-bit and 64-bit systems.

See http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule for more details.

Questions/patches to Evan Miller, emmiller@gmail.com.


Weibin Yao added a new directive of hash_select_port:

=== hash_select_port ===

'''syntax''' ''hash_select_port low_port high_port''

'''default''' ''none''

'''context''' ''upstream''

The server opens the ports range from the low port to the high port.  The range is [low_port, high_port]. The total port number is (high_port - low_port + 1).

This module will choose a port with crc32 hash. The total port number should be smaller than 64. It does't support the reverse SSL proxy.

=== $hash_random_number === 

It's a pseudo random number. It's equal to the current time with millisecond.