> Jindo Soul wrote:
>
> Hi,
>
> I wonder how SessionManager handles sessions validity. Does every invocation of ASP
>script will always cause SessionManager to check which session
> has timed out? If so, wouldn't this be expensive as far as performance is
>concerned? Please enlighten me on this. Thanks for you input.
>
Yes the session manager does do this extra check, even to update
a timestamp for the session each request. And this is expensive.
Even if Apache::Session used the same storage mechanism, it would
be faster because of the lack of session management. At a most
basic level, one day you would need to purge old Apache::Session
records to reduce the data set size, and will likely have to
code up your own solution for this.
A simple hello world script with my dev 2.23 Apache::ASP
has these performance characteristics with & without $Session
turned on ( quick 15 second benchmark ):
Test Name Test File Hits/sec # of Hits Time(sec)
secs/Hit Bytes/Hit
--------- --------- --------- --------- ---------
--------- ---------
Apache::ASP hello.asp 317.7 4770 15.01
0.003147 242
Apache::ASP $Session On hello.asp 134.4 2017 15.01
0.007441 307
The important thing to note is the difference of .0043 secs/hit.
If your scripts take .02 seconds to run, then this would be
a difference between 41 hits/sec & 50 hits/sec your scripts
could deliver, not accounting for the overhead for using
Apache::Session.
A bigger test script, h2000 highlights this difference:
Test Name Test File Hits/sec # of Hits Time(sec)
secs/Hit Bytes/Hit
--------- --------- --------- --------- ---------
--------- ---------
Apache::ASP 2000 h2000.asp 198.7 2983 15.01
0.005032 28998
Apache::ASP 2000 $Session On h2000.asp 107.0 1606 15.01
0.009344 29063
In evaluating whether you would like to use Apache::ASP's
native $Session, and if concerned about performance, I
would recommend deciding on what performance you need,
and seeing whether using ASP's session gets in the way
of this by doing some benchmarking. If your scripts
are significantly complex, I will bet that your performance
issues will be in their complexity, and not in the
session management overhead.
Finally, I would recommend using Apache::Session if you
want to set up a web cluster. One could mount Apache::ASP
StateDir on a network file system, but this is not how I
would do it, unless I had a great network file server cluster
to mount to. One day we will have native Apache::ASP sessions
that go to the database, but if that is what you really need NOW,
then I'd use Apache::Session.
-- Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks Founder Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]