The real answer to your question is:
It all depends on the expected load on your web site. Using session
variables doesn't really effect the perceived speed of your site on small or
average sites. In fact using session variables for the most fequently used
data will help speed up access compared to continued hitting of a database
(unless you cache database results). Where session variables will bite you
is on sites which have a high load factor. If you are storing 100 variables
per person that may not be much data, but storing 100 variables for 1000
people at the same time can begin putting enough load on your web server to
begin effecting performance.
There is no majic number for the ideal number of session variables to use
quite honestly. Just use Session Variables on the extremely reusuable data
and use better judgement and then load test, load test, load test. Session
variables are awesome but don't go overboard.
On average I store only 10 variables per person in the session on my sites.
I also usually stash 5 data arrays or Data objects in my application object.
So when you say 100 variables per session,I suspect you might have some data
that should be stashed in the application object also.
Hope this helps
Casey Kochmer
[EMAIL PROTECTED]
>From: Vaishali Joshi <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Limit on Session variables and Performance
>Date: Fri, 16 Jun 2000 09:14:44 EDT
>
>Hi All Java gurus
>
>Does anyone has any idea about performance of a site if lots of information
>is stored in a session. There may not be too many sessions at one time, but
>in one session lots of information (around 100 variables) will be stored.
>Some of the information will be too long too as description.
>We are having a tabbed web application, and the issue is whether to store
>the information in a database as we move from one tab to another or should
>we store it in session. Putting it in database will be like lots of calls
>to
>database, and if the user changes the information by going back and forth
>between tabs then we are doing lots of rewriting to the database. And at
>the
>end, user might even cancel everything, so we will end up having these
>kinds
>of useless records in database. But I am not sure about how putting this
>huge number of data in session will affect the performance. The other
>option
>is putting some data in session and some in temp tables..
>
>I would appreciate if you can throw some light on these issues..
>
>Thanks
>Vaishali
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>http://java.sun.com/products/jsp/faq.html
>http://www.esperanto.org.nz/jsp/jspfaq.html
>http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets