views:

1629

answers:

4

Hi to Everyone..

Actually i am new in asp.net, i am using 5 different session variable in one of my web application. My question: Is there is any performance differs? If yes please tell the reason and what should i use instead of session variable because 5-session variables are compulsaryly needed in my application....without that i cannot accomplish my task...

Advance Thanks to everyone.....

A: 

There should be no performance problem unless the objects you are storing are huge or you have to scale to a very large number of users. The ASP.NET session is very efficient. Here's a decent article on improving ASP.NET performance (it's a little old but mostly still relevant). Another good article here.

JP Alioto
Thanks for your respone, I am storing only 10 to 20 character of string data in each session and i am accessing session all the page in my application.Once again thanks for your response...
A: 

Venkatesh, it depends on the size of objects that you are storing to your session. Five variable should not be a big deal normally. Always consider that all the session variable are stored in your session store, which is asp.net runtime process itself by default. If you gotta a lot of data to store in session you may consider other session stores like database or separate session service store.

Multiply the size of data members of the objects stored in session with number of users can be online at a given moment. You will get the rough figure of bytes of main memory required on web server.

Hope this helps!

Faheem
Thanks for your respone, I am storing only 10 to 20 character of string data in each session and i am accessing session all the page in my application.Once again thanks for your response..
Well, 20 to 40 bytes should not be a problem. With 40 bytes and 1 million users you would roughly require 40 MB of memory.
Faheem
A: 

Could Any one has any idea about the initial size of Session variable?

A: 

Why not, try to use minimum session variable because they can poses the problem of Physical memory requirement.