Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How much can Session variables contain?

Status
Not open for further replies.

multiplex77

Programmer
Dec 25, 2001
302
SG
HI,

I've got some persistant data that needs to be shared across all the pages of my ASP site for each individual session. I would have used a Session variable to store this data, but I think it is way too large (content ranges from 50 to 50,000 characters).

So instead, I have used an include to query the database at the start of every page, to retrieve that data and store it in a local page variable, knowing full well that my site could take a performance hit due to the lengthy database query at the start of every page.

Q 1: How much data can a single session variable contain?

Q 2: How much can a local variable contain?

Q 3: Is there any better way to do what I need to do?

Thanks very much for the help.
 
I find it hard to imagine you needing 50,000 characters in a variable 'just in case' you need ?some of it? on a page.

While the site may take a performance hit retrieving it from the database, your web server would probably take more of a hit under load if it had to cache 50,000 characters per user.

Firstly, do you need ALL the potentially 50,000 characters all the time? Or sometimes just refer to some of it? It's much more efficient to pull what is required (and no more) from a database, than it is to cache it in the web server.

codestorm
Fire bad. Tree pretty. - Buffy
Kludges are like lies.
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
I would recommend paging all data from the database... 50,000 characters is a hefty ammount of pages, that poor server.

www.vzio.com
ASP WEB DEVELOPMENT



 
Thanks for all the advice.

Yes I agree that 50,000 char is a lot. I will try a workaround. Appreciate your help.

Is anyone able to answer my questions 1 & 2 above? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top