472,122 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

Session Variables Question

Can somebody tell me how many Session variables would be considered
exessive, and when they start really affect the server speed.
For example on 20-30 asp pages I need to use about 200-300 session variables
and 5 arrays by 1000 elements 50 characters long each.
Let say having 300 users using those pages at the same time.
Server is not the fastest one, just CPU 2.40GHz.

So question is as a user am I going to feel a difference in speed between if
I am the only user,
and if all 300 users are online at the same time.

And if using of so many session variables not a good idea, so what's an
alternative?

Regards,
Michael
Sep 10 '06 #1
2 1674

"Michaelk" <mi******@gizmowireless.comwrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
Can somebody tell me how many Session variables would be considered
exessive, and when they start really affect the server speed.
For example on 20-30 asp pages I need to use about 200-300 session
variables
and 5 arrays by 1000 elements 50 characters long each.
Let say having 300 users using those pages at the same time.
Server is not the fastest one, just CPU 2.40GHz.

So question is as a user am I going to feel a difference in speed between
if
I am the only user,
and if all 300 users are online at the same time.
You didn't specify how much memory you have but a conserative estimate would
put the memory requirement at 300MB for the data described

The answer really depends not on how many users you have but how many
requests per second will be processed and how much of this session data is
needed by those requests. A key problem area would be the arrays which need
to be copied into the request execution context and if modified copied back
to the session object. Each represents the copying of 100Kbytes and the
allocation/deallocation 5000 strings.

If you only get one request per second and only a sub-set of the arrays and
other variables are used per request you could probably get away with this.
And if using of so many session variables not a good idea, so what's an
alternative?
An alternative is to use a Database. Store useful groups of values in a set
of tables and of course each array in tables, each table should contain a
key field that links the data to your session. You can then just store a
few highly active session variables in the session object and store in the
session object a key that represents your sessions data in the DB. You will
need some housekeeping to eliminate data from sessions that are no longer
active.

Regards,
Michael


Sep 11 '06 #2
Thanks Antony.
Actually I have all this data in the SQL server right now, and a few session
variables.
Just was thinking if it makes a sense to trade all those database
connections and
browsing recordsets to load the data ones in the session variables and have
it
all handy right here in the session, specially arrays.

Regards,
Michael

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:OR**************@TK2MSFTNGP03.phx.gbl...
>
"Michaelk" <mi******@gizmowireless.comwrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
>Can somebody tell me how many Session variables would be considered
exessive, and when they start really affect the server speed.
For example on 20-30 asp pages I need to use about 200-300 session
variables
>and 5 arrays by 1000 elements 50 characters long each.
Let say having 300 users using those pages at the same time.
Server is not the fastest one, just CPU 2.40GHz.

So question is as a user am I going to feel a difference in speed between
if
>I am the only user,
and if all 300 users are online at the same time.

You didn't specify how much memory you have but a conserative estimate
would
put the memory requirement at 300MB for the data described

The answer really depends not on how many users you have but how many
requests per second will be processed and how much of this session data is
needed by those requests. A key problem area would be the arrays which
need
to be copied into the request execution context and if modified copied
back
to the session object. Each represents the copying of 100Kbytes and the
allocation/deallocation 5000 strings.

If you only get one request per second and only a sub-set of the arrays
and
other variables are used per request you could probably get away with
this.
>And if using of so many session variables not a good idea, so what's an
alternative?

An alternative is to use a Database. Store useful groups of values in a
set
of tables and of course each array in tables, each table should contain a
key field that links the data to your session. You can then just store a
few highly active session variables in the session object and store in the
session object a key that represents your sessions data in the DB. You
will
need some housekeeping to eliminate data from sessions that are no longer
active.

>Regards,
Michael



Sep 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Xizor | last post: by
2 posts views Thread by Brad | last post: by
5 posts views Thread by Abhilash.k.m | last post: by
10 posts views Thread by tshad | last post: by
3 posts views Thread by Alan Wang | last post: by
26 posts views Thread by BillE | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.