On Wed, Apr 20, 2011 at 12:11 PM, agentzh <agentzh@gmail.com> wrote:
>
> Another way is to use Lua to pick up a memcached backend from your
> memcached cluster, such that you can define your own hashing
> algorithm, including your custom consistent hashing ones.
>
Here's an example for defining custom backend routing rules in Lua (by
means of our ngx_lua module) from my slides:
http://agentzh.org/misc/slides/nginx-state-of-the-art/#67
http://agentzh.org/misc/slides/nginx-state-of-the-art/#68
http://agentzh.org/misc/slides/nginx-state-of-the-art/#69
http://agentzh.org/misc/slides/nginx-state-of-the-art/#70
Well, you can also use the arrow keys or pageup/pagedown keys to
switch pages in my (ajax-based) slides.
> Here we use fastcgi_param to pass nginx variable $backend to your
> fastcgi app such that your fastcgi app can read that from its
> environment MEMC_BACKEND. Another approach is to append the $backend
> value to the query string of the forwarded http request.
>
Basically it's as simple as
fastcgi_param QUERY_STRING "$query_string&_memc_backend=$backend";
Cheers,
-agentzh
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx