Welcome! Log In Create A New Profile

Advanced

[nginx] new upstream module // sticky cookies

Jérôme Loyet
June 05, 2010 01:00PM
Hi nginx dev,

for internal need, I wrote an upstream module which use a sticky
cookie to ensure a client is always sent to the same backend server.

All the loadbalancing intelligence stays in the
ngx_http_upstream_round_robin.c part of nginx core.

You can see the simple general algorithm in the following diagramm
http://nginx-sticky-module.googlecode.com/svn/trunk/docs/sticky.pdf

If you have time, can you review the code and see if I'm not doing
some stuff senselessly ?

Usage
upstream {
sticky;
server 127.0.0.1:9000;
server 127.0.0.1:9001;
server 127.0.0.1:9002;
}

sticky [name=route] [domain=.foo.bar] [path=/] [expires=1h];
- name: the name of the cookies used to track the persistant
upstream server
Default: route
- domain: the domain in which the cookie will be valid
Default: nothing. Let the browser handle this.
- path: the path in which the cookie will be valid
Default: nothing. Let the browser handle this.
- expires: the validity duration of the cookie
Default: nothing. It's a session cookie.
Restriction: must be a duration greater than one second

You can try it by downloading the version 1.0-rc1 at
http://code.google.com/p/nginx-sticky-module/downloads/detail?name=nginx-sticky-module-1.0-rc1.tar.gz&can=2&q=

The project page is: http://code.google.com/p/nginx-sticky-module/

Thx
++ Jerome

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

[nginx] new upstream module // sticky cookies

Jérôme Loyet 4383 June 05, 2010 01:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 252
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