0

We have an ASP.NET Webforms application, where currently we are storing our session data in a State Server. Now we wish to increase the session timeout period for the application.

This is Of course possible, but for this we need to calculate the new hardware requirements.

And hence we need to see the size of the objects stored in the session. Could you please suggest any way/tool that can help us to identify the size of various objects stored in the session.

Any help or pointers would be greatly appreciated.

  • Did you even try to research this first? Like google maybe? http://stackoverflow.com/questions/198082/how-to-find-out-size-of-session-in-asp-net-from-web-application – Rick S Jul 21 '16 at 15:41
  • I tried this but it just gives the overall size of the session and not the size of all the objects contained in it. – James Anderson Jul 21 '16 at 15:42

2 Answers2

1

NO, in that case you will have calculate the object before storing to session and make a total memory footprint size. See here on how you can get the size of object

How to get object size in memory?

Community
  • 1
  • 1
Rahul
  • 73,987
  • 13
  • 62
  • 116
  • I think may be memory profilers (not sure though) can come in handy, but as a last resort I would definitely try this. Thanks. – James Anderson Jul 21 '16 at 15:53
1

we need to see the size of the objects stored in the session.

In State Server, you cannot see individual Session's size.

However, you can see the over all memory usage of aspnet_state.exe inside Task Manager. I believe it is enough to determine how much memory you need for new server.

If you want very detail, you want to spin up a new SQL Server (just for few hours to few days) to store session state, and then query the following to get the individual session state object -

SELECT [sessionid],[created], datalength(SessionItemLong) 
FROM ASPStateTempSessions

Other Thought

If you are making a total new environment, I would suggest you to look at StackExchange's Redis Cache which is also used in Windows Azure.

Win
  • 58,817
  • 13
  • 98
  • 174