Stupid question about session expiration handling..

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Stupid question about session expiration handling..

Rick Flower
I think I may have some poor preconceived notions of what Seaside is
doing behind my back with expired sessions and am hoping someone can
shed some light on what I'm wrong about.. I guess I was under the
impression that if I set the session timeout in my Seaside app's config
page to something like 60 seconds (just for fun) and then hit "New
Session" a bunch of times to get a bunch of new WASession objects
(actually my subclassed object instead) that after 60 seconds, those
would get house-cleaned away along with any resources they held on to..

I've tried this experiment and it doesn't appear to work that way.. It
seems more like the case that when I press "New Session" (or any link
for that matter) on an expired page, it expires the page and redraws a
new page ala the ExpiredSession handler class.. However.. it seems like
the session that was expired goes and sits in a cache of some sort that
will get purged when I call "WARegistry clearAllHandlers" and then let a
garbage collection take place..

Is this what is more or less going on or am I a bit off-base?  What I
want to happen more or less is that when a session expires (however long
that takes), that my entire session class (subclass of WASession) is
garbage collected along with any database connections that are part of it.

So.. Is one of these not too far off or is there door #3?

MTIA!
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Stupid question about session expiration handling..

Ramon Leon-5
> I think I may have some poor preconceived notions of what
> Seaside is doing behind my back with expired sessions and am
> hoping someone can shed some light on what I'm wrong about..
> I guess I was under the impression that if I set the session
> timeout in my Seaside app's config page to something like 60
> seconds (just for fun) and then hit "New Session" a bunch of
> times to get a bunch of new WASession objects (actually my
> subclassed object instead) that after 60 seconds, those would
> get house-cleaned away along with any resources they held on to..
>
> I've tried this experiment and it doesn't appear to work that
> way.. It seems more like the case that when I press "New
> Session" (or any link for that matter) on an expired page, it
> expires the page and redraws a new page ala the
> ExpiredSession handler class.. However.. it seems like the
> session that was expired goes and sits in a cache of some
> sort that will get purged when I call "WARegistry
> clearAllHandlers" and then let a garbage collection take place..
>
> Is this what is more or less going on or am I a bit off-base?
>  What I want to happen more or less is that when a session
> expires (however long that takes), that my entire session
> class (subclass of WASession) is garbage collected along with
> any database connections that are part of it.
>
> So.. Is one of these not too far off or is there door #3?
>
> MTIA!

It's like garbage collection, just because a session expires in 60, doesn't
mean it'll be done, it just means it becomes invalid after that.  Sessions
are clean, by incoming requests, every 10th one I think.  Most of us who run
real sites run a background process to continually expire old sessions so
that we don't pause an incoming request to do it.

Ramon Leon
http://onsmalltalk.com 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Stupid question about session expiration handling..

Sebastian Sastre-2
 

-----Mensaje original-----
De: [hidden email]
[mailto:[hidden email]] En nombre de Ramon Leon
Enviado el: Viernes, 09 de Febrero de 2007 20:13
Para: 'The Squeak Enterprise Aubergines Server - general discussion.'
Asunto: RE: [Seaside] Stupid question about session expiration handling..

> I think I may have some poor preconceived notions of what Seaside is
> doing behind my back with expired sessions and am hoping someone can
> shed some light on what I'm wrong about..
> I guess I was under the impression that if I set the session timeout
> in my Seaside app's config page to something like 60 seconds (just for
> fun) and then hit "New Session" a bunch of times to get a bunch of new
> WASession objects (actually my subclassed object instead) that after
> 60 seconds, those would get house-cleaned away along with any
> resources they held on to..
>
> I've tried this experiment and it doesn't appear to work that way.. It
> seems more like the case that when I press "New Session" (or any link
> for that matter) on an expired page, it expires the page and redraws a
> new page ala the ExpiredSession handler class.. However.. it seems
> like the session that was expired goes and sits in a cache of some
> sort that will get purged when I call "WARegistry clearAllHandlers"
> and then let a garbage collection take place..
>
> Is this what is more or less going on or am I a bit off-base?
>  What I want to happen more or less is that when a session expires
> (however long that takes), that my entire session class (subclass of
> WASession) is garbage collected along with any database connections
> that are part of it.
>
> So.. Is one of these not too far off or is there door #3?
>
> MTIA!

It's like garbage collection, just because a session expires in 60, doesn't
mean it'll be done, it just means it becomes invalid after that.  Sessions
are clean, by incoming requests, every 10th one I think.  Most of us who run
real sites run a background process to continually expire old sessions so
that we don't pause an incoming request to do it.

Ramon Leon
http://onsmalltalk.com 

Regarding to that background process for production, could you tell more
about it? What exactly does and how often? I can imagine something like
WARegistry clearAllHandlers followed by some deep garbagecollect, but I like
to hear that from someone with production experience,

Thanks

Sebastian

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Stupid question about session expiration handling..

Lukas Renggli
In reply to this post by Ramon Leon-5
> It's like garbage collection, just because a session expires in 60, doesn't
> mean it'll be done, it just means it becomes invalid after that.  Sessions
> are clean, by incoming requests, every 10th one I think.  Most of us who run
> real sites run a background process to continually expire old sessions so
> that we don't pause an incoming request to do it.

Just as a side remark: Even tough this sounds interesting, I don't
know of any productive application that does this.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Stupid question about session expiration handling..

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Rick Flower
Re: [Seaside] Stupid question about session expiration handling..

Same here, we didn't do anything like this, normal expiry seems to work just fine and our db sessions are pooled so there's little pressure to rid of sessions as soon as they expire. And if there's a lot of activity, the current mechanism will kick in anyway, cleaning up when no one is on will make little difference as I see it at the moment.

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: The Squeak Enterprise Aubergines Server - general discussion. <[hidden email]>
Sent: Fri Feb 09 22:07:51 2007
Subject: Re: [Seaside] Stupid question about session expiration handling..

> It's like garbage collection, just because a session expires in 60, doesn't
> mean it'll be done, it just means it becomes invalid after that.  Sessions
> are clean, by incoming requests, every 10th one I think.  Most of us who run
> real sites run a background process to continually expire old sessions so
> that we don't pause an incoming request to do it.

Just as a side remark: Even tough this sounds interesting, I don't
know of any productive application that does this.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Stupid question about session expiration handling..

Nevin Pratt
In reply to this post by Lukas Renggli
Lukas Renggli wrote:

>> It's like garbage collection, just because a session expires in 60,
>> doesn't
>> mean it'll be done, it just means it becomes invalid after that.  
>> Sessions
>> are clean, by incoming requests, every 10th one I think.  Most of us
>> who run
>> real sites run a background process to continually expire old
>> sessions so
>> that we don't pause an incoming request to do it.
>
> Just as a side remark: Even tough this sounds interesting, I don't
> know of any productive application that does this.
>
> Cheers,
> Lukas
>
Same here.  Neither of our production sites do this.

Nevin

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Stupid question about session expiration handling..

Ramon Leon-5
In reply to this post by Boris Popov, DeepCove Labs (SNN)
> Same here, we didn't do anything like this, normal expiry
> seems to work just fine and our db sessions are pooled so
> there's little pressure to rid of sessions as soon as they
> expire. And if there's a lot of activity, the current
> mechanism will kick in anyway, cleaning up when no one is on
> will make little difference as I see it at the moment.
>
> Cheers!
>
> -Boris
> (Sent from a BlackBerry)
>
>
> Just as a side remark: Even tough this sounds interesting, I
> don't know of any productive application that does this.
>
> Cheers,
> Lukas
>

OK, well maybe others aren't doing it.  I know someone is, because running a
background reaper wasn't my idea, I took it from someone on this list.  What
it does do, is avoid stalling that person who happens to be the 10th
connection and kicks off a session expiration.  If you look back in the
history of this list a bit, you'll find a few complaints about that.

I run a background service that does this every 30 seconds ...

(WADispatcher default entryPoints
    select: [:app | app respondsTo: #unregisterExpiredHandlers])
    do: [:app | app unregisterExpiredHandlers]

Sessions can take up a lot of memory, depending on what you do, and when
running a public web site, I want to ensure memory is released as soon as
possible.

Ramon Leon
http://onsmalltalk.com 

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside