Session Variables Question

Discussion in 'ASP General' started by Michaelk, Sep 10, 2006.

  1. Michaelk

    Michaelk Guest

    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
    Michaelk, Sep 10, 2006
    #1
    1. Advertising

  2. "Michaelk" <> wrote in message
    news:...
    > 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
    >
    >
    Anthony Jones, Sep 11, 2006
    #2
    1. Advertising

  3. Michaelk

    Michaelk Guest

    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" <> wrote in message
    news:...
    >
    > "Michaelk" <> wrote in message
    > news:...
    >> 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
    >>
    >>

    >
    >
    Michaelk, Sep 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob

    Global Session Variables and Session State

    Earl Teigrob, Dec 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,270
    Alvin Bruney
    Dec 17, 2003
  2. =?iso-8859-15?Q?Fabr=EDcio_de_Novaes_Kucinskis?=

    Session Variables assigned to the wrong session?

    =?iso-8859-15?Q?Fabr=EDcio_de_Novaes_Kucinskis?=, Jan 20, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    709
    Alvin Bruney [MVP]
    Jan 20, 2005
  3. Robert Faulkner
    Replies:
    0
    Views:
    877
    Robert Faulkner
    Jan 28, 2005
  4. Replies:
    1
    Views:
    931
  5. Replies:
    9
    Views:
    935
Loading...

Share This Page