session variables and single thread slow downs

Results 1 to 2 of 2

Thread: session variables and single thread slow downs

  1. #1
    paul13 Guest

    Default session variables and single thread slow downs

    i am trying to repair someone else&#039s asp pages. they tend to slow down, and i think it is because they use session variables. i have heard that session variables force pages to be single threaded. is this true, and is there any way around this problem without replacing all of the session variables?<BR><BR>thanks<BR><BR>paul13

  2. #2
    Join Date
    Dec 1969

    Default RE: session variables and single thread slow downs

    you&#039ve got your wires crossed<BR><BR>session variables per se don&#039t lock down to single threads. what does is storing Apartment Threaded components in session or Application scope. the slowness of a website can be due to hundreds of different factors. If there are many simultaneous visitors, sessions variables will cause some slowdown - and it&#039s best to use them as little as possible.<BR><BR>try and cut down on the following<BR><BR>redundant variables (two or more sesion variables that essentially mean the same thing, i.e. storing a username and a userID in sesion vars instead of just the unique ID)<BR>repeated opening and closing of connections - database connections are VERY costly. if they&#039re not required, get rid of them<BR>open connections at the last possible second, close them at the first<BR><BR>avoid repeatedly accessing the same object (don&#039t call Request.Querystring("myvar") eight times in a page if you can assign it to a script variable i.e. myvar = request.querystring("myvar"))<BR>watch out for large includes. a project i once worked on had a 250Kb+ include when I arrived, and ran like a dog. I broke it into little bits and optimised the functions inside, and suddenly it ran like a dream.<BR>definitely don&#039t store objects in sesion or app. if you don&#039t know their threading model<BR><BR>there ya go<BR><BR>j<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts