# New patch: upstream consist hash patch

**URL:** <https://www.ruby-forum.com/t/new-patch-upstream-consist-hash-patch/170023>\
**Category:** NGINX\
**Created:** [June 11, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/new-patch-upstream-consist-hash-patch/170023 "2009-06-11T14:14:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![i\_amok\_i\_amok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@i\_amok\_i\_amok](https://www.ruby-forum.com/u/i_amok_i_amok)\
**Post date:** [June 11, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/new-patch-upstream-consist-hash-patch/170023/1 "2009-06-11T14:14:56Z")

</div>

hi,all

```
  i has patch the upstream hash module to support consist hash.

```

below is patch file and patch method.

[http://upstream-consist-hash.googlecode.com/files/upstream\_hash.path](http://upstream-consist-hash.googlecode.com/files/upstream_hash.path)  
[http://upstream-consist-hash.googlecode.com/files/nginx.path](http://upstream-consist-hash.googlecode.com/files/nginx.path)

patch method:

#patch nginx  
cd nginx-0.7.17  
patch -p1 \< …/nginx.path

#patch upstream hash  
cd nginx\_upstream\_hash-0.3  
patch -p1 \< …/upstream\_hash.path

#download ketama-0.1.1.tar.bz2  
cd ketama/libketama  
gcc -fPIC -O3 -c md5.c  
gcc -shared -o libmd5.so md5.o  
cp libmd5.so /usr/local/lib  
cp md5.h /usr/local/include

#in case you maybe need edit /etc/ld.so.conf to add the  
/usr/local/lib path , then ldconfig

ps: thank for Evan M. give me help:)

---

<div class="post-metadata">

**Author:** ![i\_amok\_i\_amok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@i\_amok\_i\_amok](https://www.ruby-forum.com/u/i_amok_i_amok)\
**Post date:** [June 11, 2009, 3:21pm UTC](https://www.ruby-forum.com/t/new-patch-upstream-consist-hash-patch/170023/2 "2009-06-11T15:21:54Z")

</div>

Hello!

On Thu, Jun 11, 2009 at 08:04:41PM +0800, i\_amok i\_amok wrote:

> hi,all
> 
> ```
> i has patch the upstream hash module to support consist hash.
> 
> ```
> 
> below is patch file and patch method.
> 
> [http://upstream-consist-hash.googlecode.com/files/upstream\_hash.path](http://upstream-consist-hash.googlecode.com/files/upstream_hash.path)  
> [http://upstream-consist-hash.googlecode.com/files/nginx.path](http://upstream-consist-hash.googlecode.com/files/nginx.path)

As far as I see patch to nginx itself isn’t really needed. You may  
easily keep everything within the module.

And just a note: there is Tomash Brechko’s memcached\_hash module  
that does ketama consistent hashing among others. As far as I know  
it works well. See

[http://openhack.ru/nginx-patched/wiki/MemcachedHash](http://openhack.ru/nginx-patched/wiki/MemcachedHash)

for details.

Maxim D.

---

<div class="post-metadata">

**Author:** ![i\_amok\_i\_amok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/9fc348/32.png) [@i\_amok\_i\_amok](https://www.ruby-forum.com/u/i_amok_i_amok)\
**Post date:** [June 11, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/new-patch-upstream-consist-hash-patch/170023/3 "2009-06-11T17:05:57Z")

</div>

yes , thx for you remind, just let people know there is a option to do  
consistent hash for upstream hash module…🙂

2009/6/11 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
