[Lift] Re: NGinx and sticky sessions

2010-01-13 Thread Marius
No I'm not using JSESSIONID because in my app (non lift) I'm not using
container's session management.

But thanks for the HA proxy tip.

Br's,
Marius

On Jan 13, 4:54 pm, Alex Boisvert  wrote:
> I'm not sure if you discussed this but based on my experience, the
> JSESSIONID cookie is used most often in Jetty/Tomcat/J2EE environments for
> load balancing (over using client IP).
>
> I haven't used nginx for load balancing yet but I've used both HAProxy and
> Varnish in the past.
>
> http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
>
> alex
>
> On Wed, Jan 13, 2010 at 4:22 AM, Timothy Perrett 
> wrote:
>
> > To follow up this thread for completeness, I communicated to Marius that he
> > needs to use:
>
> >http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule
>
> > Which should do what he wants.
>
> > Cheers, Tim
>
> > On 13 Jan 2010, at 12:02, Marius wrote:
>
> > > On Jan 13, 1:42 pm, Timothy Perrett  wrote:
> > >> Nginx offers weighted round robin requests if memory serves... what does
> > your config look like? The upstream module should be cool for what you want.
>
> > >>http://wiki.nginx.org/NginxHttpUpstreamModule
>
> > >> See that it uses class-c ip hashing to always distribute requests to the
> > same backend node... making the query string redundant :-)
>
> > > I'm not sure about that. The flow I have is this:
>
> > > 1. client sends a login request with not server_id info.
> > > 2. LB needs to dispatch to any node
> > > 3. The node that responds back is setting the server_id information in
> > > the HTTP response header (based on config files info from each node)
> > > 4. The next subsequent requests for this session will also include the
> > > server_id information received and here is the balancing rules I
> > > need.
>
> > > I'm not sure I should use client's IP address because clients may be
> > > behind NATs etc. and this may unbalance the cluster.
>
> > > Currently I have no config, so I'm still not sure how to config my
> > > case described here.
>
> > >> Cheers, Tim
>
> > >> On 13 Jan 2010, at 11:29, Marius wrote:
>
> > >>> Hi all,
>
> > >>> Did anyone here used nginx with sticky sessions? What I'm looking for
> > >>> is:
>
> > >>> if a request comes in with e certain HTTP header or query string
> > >>> paramers the request should be dispatched to a given node. So I have a
> > >>> header like server_id=1 -> dispatch the request to node1, if
> > >>> server_id=2 dispatch the request to node2 and so on.
>
> > >>> Is it possible to configure nginx like this?
>
> > >>> Br's,
> > >>> Marius
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups "Lift" group.
> > >>> To post to this group, send email to lift...@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > >>> For more options, visit this group athttp://
> > groups.google.com/group/liftweb?hl=en.
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




Re: [Lift] Re: NGinx and sticky sessions

2010-01-13 Thread Alex Boisvert
I'm not sure if you discussed this but based on my experience, the
JSESSIONID cookie is used most often in Jetty/Tomcat/J2EE environments for
load balancing (over using client IP).

I haven't used nginx for load balancing yet but I've used both HAProxy and
Varnish in the past.

http://haproxy.1wt.eu/download/1.2/doc/architecture.txt

alex


On Wed, Jan 13, 2010 at 4:22 AM, Timothy Perrett wrote:

> To follow up this thread for completeness, I communicated to Marius that he
> needs to use:
>
> http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule
>
> Which should do what he wants.
>
> Cheers, Tim
>
> On 13 Jan 2010, at 12:02, Marius wrote:
>
> >
> >
> > On Jan 13, 1:42 pm, Timothy Perrett  wrote:
> >> Nginx offers weighted round robin requests if memory serves... what does
> your config look like? The upstream module should be cool for what you want.
> >>
> >> http://wiki.nginx.org/NginxHttpUpstreamModule
> >>
> >> See that it uses class-c ip hashing to always distribute requests to the
> same backend node... making the query string redundant :-)
> >
> > I'm not sure about that. The flow I have is this:
> >
> > 1. client sends a login request with not server_id info.
> > 2. LB needs to dispatch to any node
> > 3. The node that responds back is setting the server_id information in
> > the HTTP response header (based on config files info from each node)
> > 4. The next subsequent requests for this session will also include the
> > server_id information received and here is the balancing rules I
> > need.
> >
> > I'm not sure I should use client's IP address because clients may be
> > behind NATs etc. and this may unbalance the cluster.
> >
> > Currently I have no config, so I'm still not sure how to config my
> > case described here.
> >
> >>
> >> Cheers, Tim
> >>
> >> On 13 Jan 2010, at 11:29, Marius wrote:
> >>
> >>> Hi all,
> >>
> >>> Did anyone here used nginx with sticky sessions? What I'm looking for
> >>> is:
> >>
> >>> if a request comes in with e certain HTTP header or query string
> >>> paramers the request should be dispatched to a given node. So I have a
> >>> header like server_id=1 -> dispatch the request to node1, if
> >>> server_id=2 dispatch the request to node2 and so on.
> >>
> >>> Is it possible to configure nginx like this?
> >>
> >>> Br's,
> >>> Marius
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> >>> To post to this group, send email to lift...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> >>> For more options, visit this group athttp://
> groups.google.com/group/liftweb?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups
> "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
> >
> >
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
>
>
-- 

You received this message because you are subscribed to the Google Groups "Lift" group.

To post to this group, send email to lift...@googlegroups.com.

To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Re: NGinx and sticky sessions

2010-01-13 Thread Timothy Perrett
To follow up this thread for completeness, I communicated to Marius that he 
needs to use:

http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule

Which should do what he wants. 

Cheers, Tim

On 13 Jan 2010, at 12:02, Marius wrote:

> 
> 
> On Jan 13, 1:42 pm, Timothy Perrett  wrote:
>> Nginx offers weighted round robin requests if memory serves... what does 
>> your config look like? The upstream module should be cool for what you want.
>> 
>> http://wiki.nginx.org/NginxHttpUpstreamModule
>> 
>> See that it uses class-c ip hashing to always distribute requests to the 
>> same backend node... making the query string redundant :-)
> 
> I'm not sure about that. The flow I have is this:
> 
> 1. client sends a login request with not server_id info.
> 2. LB needs to dispatch to any node
> 3. The node that responds back is setting the server_id information in
> the HTTP response header (based on config files info from each node)
> 4. The next subsequent requests for this session will also include the
> server_id information received and here is the balancing rules I
> need.
> 
> I'm not sure I should use client's IP address because clients may be
> behind NATs etc. and this may unbalance the cluster.
> 
> Currently I have no config, so I'm still not sure how to config my
> case described here.
> 
>> 
>> Cheers, Tim
>> 
>> On 13 Jan 2010, at 11:29, Marius wrote:
>> 
>>> Hi all,
>> 
>>> Did anyone here used nginx with sticky sessions? What I'm looking for
>>> is:
>> 
>>> if a request comes in with e certain HTTP header or query string
>>> paramers the request should be dispatched to a given node. So I have a
>>> header like server_id=1 -> dispatch the request to node1, if
>>> server_id=2 dispatch the request to node2 and so on.
>> 
>>> Is it possible to configure nginx like this?
>> 
>>> Br's,
>>> Marius
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> liftweb+unsubscr...@googlegroups.com.
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/liftweb?hl=en.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: NGinx and sticky sessions

2010-01-13 Thread Marius
Tim,

Thanks SO MUCH about the info from the offline talk we've had. If
other are interested, this may be helpful: 
http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule

Br's,
Marius

On Jan 13, 2:02 pm, Marius  wrote:
> On Jan 13, 1:42 pm, Timothy Perrett  wrote:
>
> > Nginx offers weighted round robin requests if memory serves... what does 
> > your config look like? The upstream module should be cool for what you want.
>
> >http://wiki.nginx.org/NginxHttpUpstreamModule
>
> > See that it uses class-c ip hashing to always distribute requests to the 
> > same backend node... making the query string redundant :-)
>
> I'm not sure about that. The flow I have is this:
>
> 1. client sends a login request with not server_id info.
> 2. LB needs to dispatch to any node
> 3. The node that responds back is setting the server_id information in
> the HTTP response header (based on config files info from each node)
> 4. The next subsequent requests for this session will also include the
> server_id information received and here is the balancing rules I
> need.
>
> I'm not sure I should use client's IP address because clients may be
> behind NATs etc. and this may unbalance the cluster.
>
> Currently I have no config, so I'm still not sure how to config my
> case described here.
>
>
>
> > Cheers, Tim
>
> > On 13 Jan 2010, at 11:29, Marius wrote:
>
> > > Hi all,
>
> > > Did anyone here used nginx with sticky sessions? What I'm looking for
> > > is:
>
> > > if a request comes in with e certain HTTP header or query string
> > > paramers the request should be dispatched to a given node. So I have a
> > > header like server_id=1 -> dispatch the request to node1, if
> > > server_id=2 dispatch the request to node2 and so on.
>
> > > Is it possible to configure nginx like this?
>
> > > Br's,
> > > Marius
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Lift" group.
> > > To post to this group, send email to lift...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > liftweb+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.




[Lift] Re: NGinx and sticky sessions

2010-01-13 Thread Marius


On Jan 13, 1:42 pm, Timothy Perrett  wrote:
> Nginx offers weighted round robin requests if memory serves... what does your 
> config look like? The upstream module should be cool for what you want.
>
> http://wiki.nginx.org/NginxHttpUpstreamModule
>
> See that it uses class-c ip hashing to always distribute requests to the same 
> backend node... making the query string redundant :-)

I'm not sure about that. The flow I have is this:

1. client sends a login request with not server_id info.
2. LB needs to dispatch to any node
3. The node that responds back is setting the server_id information in
the HTTP response header (based on config files info from each node)
4. The next subsequent requests for this session will also include the
server_id information received and here is the balancing rules I
need.

I'm not sure I should use client's IP address because clients may be
behind NATs etc. and this may unbalance the cluster.

Currently I have no config, so I'm still not sure how to config my
case described here.

>
> Cheers, Tim
>
> On 13 Jan 2010, at 11:29, Marius wrote:
>
> > Hi all,
>
> > Did anyone here used nginx with sticky sessions? What I'm looking for
> > is:
>
> > if a request comes in with e certain HTTP header or query string
> > paramers the request should be dispatched to a given node. So I have a
> > header like server_id=1 -> dispatch the request to node1, if
> > server_id=2 dispatch the request to node2 and so on.
>
> > Is it possible to configure nginx like this?
>
> > Br's,
> > Marius
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Lift" group.
> > To post to this group, send email to lift...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > liftweb+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/liftweb?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.