You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Gale <mi...@bluesuperman.com> on 2004/07/01 03:18:55 UTC

Re: [users@httpd] load balancing wih sticky session ??

Hello,

	You see the http connection to the application server requires a
session. So when you login and are accessing the java pages your browser
has a cookie with the session id and your session data is saved in
memory on the application server.

So if I have 4 app servers and client A connects and hits app server
1, then session data for client A will only be stored on app server 1
for the remainder of the session.

The next time if client A logs in to app server 2 then that session data
will be stored in app server 2. I realize this is crappy way ... but I
did not make the programs I only just got involved because they want to
cluster the application servers.

So my load balancer needs to be able to do HTTP session tracking so it
can direct the client to the correct app server.

Can apache do this by it self or with any third party software ?

Michael




On Wed, 30 Jun 2004 14:32:18 +0100 (BST)
Nick Kew <ni...@webthing.com> wrote:

> On Tue, 29 Jun 2004, Michael Gale wrote:
> 
> > So I was thinking if I could have apache handle the HTTPS request
> > and then proxy HTTP traffic to one of the internal application
> > servers that would be great. But the apache box would have to
> > maintain the session, so if the first request did not have a
> > session, establish one, and send to a application server. If the
> > request went to app server 1 - then all future request for this
> > session would have to hit app server 1.
> 
> Choose your mechanism!  If you're using cookies, for example, you
> can just store a code designating a backend in there.  If you're
> working with session variables in your URLs, it's essentially similar,
> but a little more work.
> 
> Or you could store session info on the proxy.  That's a little more
> work.
> 
> > Now I found some documentation on mod_perl and mod_session with it
> > appears that apache will do the first two parts .. but would not
> > forward the remaining http request for the session to the proper app
> > server.
> 
> How does it matter what mechanism you use?
> 
> -- 
> Nick Kew
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project. See <URL:http://httpd.apache.org/userslist.html> for more
> info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] load balancing wih sticky session ??

Posted by Nick Kew <ni...@webthing.com>.
On Wed, 30 Jun 2004, Michael Gale wrote:

> Oh ... I understand now .. we want to use cookies ... would it not just
> be easier to have the developers change the app to save all session data
> in the DB.

Well, it might.  Your developers would be best-placed to know what's
going to be easier.  But using a cookie to select a backend is pretty
trivial.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] load balancing wih sticky session ??

Posted by Michael Gale <mi...@bluesuperman.com>.
Oh ... I understand now .. we want to use cookies ... would it not just
be easier to have the developers change the app to save all session data
in the DB. 

The it would not matter what app server you hit ?

Michael


On Thu, 1 Jul 2004 06:05:56 +0100 (BST)
Nick Kew <ni...@webthing.com> wrote:

> On Wed, 30 Jun 2004, Michael Gale wrote:
> 
> > So my load balancer needs to be able to do HTTP session tracking so
> > it can direct the client to the correct app server.
> 
> That was clear enough first time you asked.  The answer is that you
> can do it, though I'm not aware of any point-and-click software for
> this. To give a more detailed answer I'd need more detail from you;
> e.g. it would be futile to suggest how to do it with session variables
> in your URIs if you'r committed to cookies, or vice versa.
> 
> -- 
> Nick Kew
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project. See <URL:http://httpd.apache.org/userslist.html> for more
> info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] load balancing wih sticky session ??

Posted by Nick Kew <ni...@webthing.com>.
On Wed, 30 Jun 2004, Michael Gale wrote:

> So my load balancer needs to be able to do HTTP session tracking so it
> can direct the client to the correct app server.

That was clear enough first time you asked.  The answer is that you can
do it, though I'm not aware of any point-and-click software for this.
To give a more detailed answer I'd need more detail from you; e.g. it
would be futile to suggest how to do it with session variables in your
URIs if you'r committed to cookies, or vice versa.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org