Welcome! Log In Create A New Profile

Advanced

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh
April 20, 2011 12:16AM
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
Subject Author Posted

How to make Nginx work with distributed/multiple memcached servers?

Andy April 15, 2011 02:09PM

Re: How to make Nginx work with distributed/multiple memcached servers?

Akins, Brian April 15, 2011 02:30PM

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh April 18, 2011 01:16AM

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh April 18, 2011 01:18AM

Re: How to make Nginx work with distributed/multiple memcached servers?

杨显功 April 18, 2011 01:56AM

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh April 18, 2011 02:24AM

Re: How to make Nginx work with distributed/multiple memcached servers?

杨显功 April 18, 2011 02:42AM

Re: How to make Nginx work with distributed/multiple memcached servers?

Andy April 19, 2011 10:09PM

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh April 20, 2011 12:12AM

Re: How to make Nginx work with distributed/multiple memcached servers?

agentzh April 20, 2011 12:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready