怀疑在asp.net(c#)网站应用程序中使用会话变量

时间:2021-12-22 01:39:59

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...

其实我是asp.net的新手,我在我的一个web应用程序中使用了5个不同的会话变量。我的问题:是否存在任何性能差异?如果是,请告诉原因以及我应该使用什么而不是会话变量,因为在我的应用程序中强制性地需要5个会话变量....没有它我无法完成我的任务...

Advance Thanks to everyone.....

预感谢大家.....

3 个解决方案

#1


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.

除非您存储的对象很大或者您必须扩展到大量用户,否则应该没有性能问题。 ASP.NET会话非常有效。这是关于提高ASP.NET性能的一篇不错的文章(它有点旧,但大部分仍然相关)。这里有另一篇好文章。

#2


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.

Venkatesh,它取决于您存储到会话中的对象的大小。五个变量通常不应该是一个大问题。始终考虑所有会话变量都存储在会话存储中,默认情况下是asp.net运行时进程本身。如果要在会话中存储大量数据,可以考虑其他会话存储,如数据库或单独的会话服务存储。

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.

将会话中存储的对象的数据成员的大小与用户数量相乘可以在给定时刻在线。您将获得Web服务器上所需的主内存字节粗略图。

Hope this helps!

希望这可以帮助!

#3


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

为什么不,尝试使用最小会话变量,因为它们可能会造成物理内存要求的问题。

#1


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.

除非您存储的对象很大或者您必须扩展到大量用户,否则应该没有性能问题。 ASP.NET会话非常有效。这是关于提高ASP.NET性能的一篇不错的文章(它有点旧,但大部分仍然相关)。这里有另一篇好文章。

#2


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.

Venkatesh,它取决于您存储到会话中的对象的大小。五个变量通常不应该是一个大问题。始终考虑所有会话变量都存储在会话存储中,默认情况下是asp.net运行时进程本身。如果要在会话中存储大量数据,可以考虑其他会话存储,如数据库或单独的会话服务存储。

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.

将会话中存储的对象的数据成员的大小与用户数量相乘可以在给定时刻在线。您将获得Web服务器上所需的主内存字节粗略图。

Hope this helps!

希望这可以帮助!

#3


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

为什么不,尝试使用最小会话变量,因为它们可能会造成物理内存要求的问题。