-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
I'm no expert in distributed systems, but...
This is a classic example of partial failure, and highlights why distributed
computing is hard and is fundamentally different than non-distributed
systems (I've been doing some reading on JINI, and clearly the philosophy is
showing).
Tommi, you have to deal with the fact that the 'system' (spanning multiple
JVM's) can get out of sync with itself. At one extreme, you could have the
entire system shutdown immediately to compensate for the partial failure.
Or, you can do nothing, and let a new session ID be assigned (what you're
doing). Somewhere in the middle, you can have some sort of 'global'
repository where session id's are stored, and reference that. Of course, if
you want to scale the repository to several JVM's (for 'fault tolerance'),
you're back where you started (a place where the state of the system cannot
always be known).
The hard fact that I think I'm learning is that if you're gonna do
distributed computing, you have to be able to accept the that (without a
central manager) the state of the system can NEVER be completely known. If
you think about it, it all gets very Schroedinger, but I won't go there...
So you have to decide for yourself how important it is for your application
to be synchronized. I don't think there's really any general solution that
could be just plugged into apache and have it meet everyone's needs.
Rather, it would be nice if there was a general framework which allowed
different implementations (varying in how tight the synchronization policy
is) to be plugged in. I have no idea what this would actually look like.
Sorry.
I just read this article last night, it's really good. Check it out. (Way
back from '94);
http://www.sunlabs.com/technical-reports/1994/abstract-29.html
Paul
-----Original Message-----
From: Tommi Reiman <[EMAIL PROTECTED]>
To: Java Apache Users <[EMAIL PROTECTED]>
Date: Thursday, August 12, 1999 12:53 PM
Subject: load balancing & sessions
>-----------------------------
>Please read the FAQ!
><http://java.apache.org/faq/>
>-----------------------------
>
>
> I have a setting in with there's one apache 1.3.6 running and two JServ
>1.0 instances all on the same machine. I've started both JServs manually
>and the load balancing seems to work nicely, but there are problems with
>sessions when I kill one of the JServs:
>
> - client comes to my apache-site, requests a servlet
> -> apache routes client to Jserv 1
>
> - new session, client needs to log in (login/passwd)
> -> get session-id = 3fc28f4de242b368.1.934485334173.JS1
>
> -> JServ 1 killed
> -> Clients session data lost (if not stored in disk)
>
> - client requests same servlet again
> -> Apache routes client to JServ 2 (which is running)
>
> -> new session is created, client needs to log in again
> - client gets new session-id: 3feeaccb6388286d.2.934485391511.JS2
> (JS1 -> JS2 not the only change in that!)
>
> When the client gets in contact with Jserv 2, he has an old session-id
>cookie with him but no session object in Jserv 2, so Jserv 2 creates a new
>session for him (not what I wanted). If any JServ developers read this, I
>would be most pleased if someone creates a possibility of a session-data
>'share', from where Jserv 2 could fetch the old session-data linked to
>that 'dead' session-id! This would require some sort of 'distributed
>shared memory' -solution, database or some other other container. Load
>balancing would be much more fault tolerant after that.
>
> Tommi
>
>
>
>--
>--------------------------------------------------------------
>Please read the FAQ! <http://java.apache.org/faq/>
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>Archives and Other: <http://java.apache.org/main/mail.html>
>Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]