You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by "Kreuzer, Harald" <Ha...@one.at> on 2001/11/12 10:19:33 UTC

Problem with SessionCount

hello!

first of all thanks for this great piece of software!! i changed my site
from ms-asp to apache::asp and i am very happy with it.
now my problem: i updated some days ago to asp 2.27 and it seems as if i
don't get Session_OnEnd events anymore. i have a statistics page on my site
where i can see the current number of session (with
$Application->SessionCount() ), and since i have installed the new version
it's getting higher and higher but never decreases. did there change
something that i missed? I use asp 2.27, mod_perl 1.26 perl 5.6.1 and apache
1.3.22.

thanks for your help!

harald

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Problem with SessionCount

Posted by Joshua Chamas <jo...@chamas.com>.
"Kreuzer, Harald" wrote:
> 
> hello!
> 
> first of all thanks for this great piece of software!! i changed my site
> from ms-asp to apache::asp and i am very happy with it.
> now my problem: i updated some days ago to asp 2.27 and it seems as if i
> don't get Session_OnEnd events anymore. i have a statistics page on my site
> where i can see the current number of session (with
> $Application->SessionCount() ), and since i have installed the new version
> it's getting higher and higher but never decreases. did there change
> something that i missed? I use asp 2.27, mod_perl 1.26 perl 5.6.1 and apache
> 1.3.22.
> 

I believe this is due to an optimization made in either 2.25 or 2.27
wherein a $Session would only get a Session_OnEnd event there was
something actually written to it.  The problem is that the current
session garbage collector relies on session files on disk, but these
empty sessions have no files on disk associated with them, just 
entries in the internal database.

As a temporary workaround, you could do this:

sub Session_OnStart {
  $Session->{MARK} = 1;
}

This would create the session files on disk.  I believe then 
that Session_OnEnd events would fire as normal, and your
SessionCount would keep current.  The performance penalty
of always writing to a $Session would be little more than
what was in 2.21.

I will fix this ASAP in my dev 2.29 version by reading in 
sessions for garbage collection from the internal database
instead of files on disk, which will account for the prior
optimization.  This is a change I need to make anyway for
the session garbage collector before creating a SQL db backed
implementation of $Session / $Application storage.

--Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Problem with SessionCount

Posted by Joshua Chamas <jo...@chamas.com>.
"Kreuzer, Harald" wrote:
> 
> hello!
> 
> first of all thanks for this great piece of software!! i changed my site
> from ms-asp to apache::asp and i am very happy with it.
> now my problem: i updated some days ago to asp 2.27 and it seems as if i
> don't get Session_OnEnd events anymore. i have a statistics page on my site
> where i can see the current number of session (with
> $Application->SessionCount() ), and since i have installed the new version
> it's getting higher and higher but never decreases. did there change
> something that i missed? I use asp 2.27, mod_perl 1.26 perl 5.6.1 and apache

I have a fix for this bug in my dev version 2.29, and a test case so
it won't break again in the future.  I will send you my 2.29 separately.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org