We have built an ASP.Net web application and in that we store lot of data in sessions and we are using InProc session. We would like to measure the memory usage of the web application & average session usage per user. Please let me know what is the best
way to measure the memory usage of the web application & session size.
Also we are planning to move the application to Windows Azure and we would like to know the average memory used per user to determine how many concurrent users can be supported with a particular set of memory.
The first link talks more about determining an application has a memory leak. 2nd link talks about using Visual Studio Team System 2008 to determine the memory usage. As we do not have that tool can we use performance monitor which comes with Windows 2008
to measure the memory usage?
Are the following counters useful to measure the memory usage of ASP.Net website?
# Bytes in all Heaps
# Gen 0 Collections
# Gen 1 Collections
# Gen 2 Collections
Gen 0 heap size
Gen 1 heap size
Gen 2 heap size
Large Object Heap size
Especially I am interested in measuring the session size and if there are any other counters that can be used to measure this, please share it and it would be a great help.
The ASP.NET System Performance Counters have the ability to view server-side information like Session. I would read the following so you know
which performace counters to use in the Performace Monitor tool.
I am interested more on the memory used by session variables when data is saved in the session. Looks like the performance counters can be used to know like how many active sessions, how many are timedout etc.
Please let me know what counters can be used to know the memory usage of the ASP.Net web application as well as memory usaged by the variables stored in the session if there is a way to know it.
Please let me know what counters can be used to know the memory usage of the ASP.Net web application as well as memory usaged by the variables stored in the session if there is a way to know it.
Well it appears there is no actual counter or way to single out how to measure Session Memory consumption as summed up by the following link:
Session is managed memory that is allocated from the heap and it appears
there might be some low level monitoring that can be done using WINDBG.EXE and SOS.DLL which has a command that lists the count, size, and type of objects in the managed heap. I am not familiar with using these tools for diagnosis, but you can read about some
of the details under the .NET CLR Memory Counters section in the article below:
Typically when something is not able to be done directly (like finding out
exactly how much managed memory Session state is using) then it leads me to believe one might be looking in the wrong place or that the results would not yield anything of high importance. I think the better option might be to look at the server's memory
use overall in relation to the aspnet_wp process.
Even if you found out you were dumping too much into Session what would you do as a result? You either need more memory, have to scale out the servers in the farm (but even then you have to implement a State Server so that server better have some power),
or refactor the app not to place so much in Session. I think the metrics on overall memory usage from an ASP.NET standpoint is enough to justify which course of action to take.
And lastly there is some obvious thinking to this as well. Are you dumping 1,000,000 records into a DataSet that is in Session?
That will take up some memory! Are you dumping a few simple data type values into session over each client? Probably not so bad, and if you are still having memory issues, it might be time to seek out the help of the
IIS Foums folks because configuration issues could lead to poorly performing servers and have nothing at all to do with Session state or the .NET code you have written.
ranumula
Member
20 Points
23 Posts
Measuring memory usage of a website
Mar 02, 2012 01:10 PM|LINK
Hi,
We have built an ASP.Net web application and in that we store lot of data in sessions and we are using InProc session. We would like to measure the memory usage of the web application & average session usage per user. Please let me know what is the best way to measure the memory usage of the web application & session size.
Also we are planning to move the application to Windows Azure and we would like to know the average memory used per user to determine how many concurrent users can be supported with a particular set of memory.
Any help would be greatly appreciated.
Thanks in advance.
Raghu
daisydain
Member
222 Points
51 Posts
Re: Measuring memory usage of a website
Mar 02, 2012 01:36 PM|LINK
Hello,
Follow the links below. It will help you
http://stackoverflow.com/questions/7681790/how-to-measure-memory-usage-for-a-live-asp-net-mvc-web-application
http://www.codeproject.com/Articles/132555/Performance-Testing-of-ASP-NET-Website
ranumula
Member
20 Points
23 Posts
Re: Measuring memory usage of a website
Mar 06, 2012 05:11 AM|LINK
Hi,
The first link talks more about determining an application has a memory leak. 2nd link talks about using Visual Studio Team System 2008 to determine the memory usage. As we do not have that tool can we use performance monitor which comes with Windows 2008 to measure the memory usage?
Are the following counters useful to measure the memory usage of ASP.Net website?
Especially I am interested in measuring the session size and if there are any other counters that can be used to measure this, please share it and it would be a great help.
Thanks in advance.
Raghu
atconway
All-Star
16846 Points
2756 Posts
Re: Measuring memory usage of a website
Mar 06, 2012 01:54 PM|LINK
The ASP.NET System Performance Counters have the ability to view server-side information like Session. I would read the following so you know which performace counters to use in the Performace Monitor tool.
ASP.NET System Performance Counters:
http://msdn.microsoft.com/en-us/library/fxk122b4.aspx
Monitoring ASP.NET Application Performance:
http://msdn.microsoft.com/en-us/library/3xxk09t8.aspx
How to: View the ASP.NET Performance Counters Available on Your Computer:
http://msdn.microsoft.com/en-us/library/xhcx5a20.aspx
ranumula
Member
20 Points
23 Posts
Re: Measuring memory usage of a website
Mar 07, 2012 09:30 AM|LINK
Hi,
I am interested more on the memory used by session variables when data is saved in the session. Looks like the performance counters can be used to know like how many active sessions, how many are timedout etc.
Please let me know what counters can be used to know the memory usage of the ASP.Net web application as well as memory usaged by the variables stored in the session if there is a way to know it.
Thanks in advance.
Raghu
atconway
All-Star
16846 Points
2756 Posts
Re: Measuring memory usage of a website
Mar 07, 2012 03:24 PM|LINK
Well it appears there is no actual counter or way to single out how to measure Session Memory consumption as summed up by the following link:
How can I determine the memory footprint of a session variable?
Session is managed memory that is allocated from the heap and it appears there might be some low level monitoring that can be done using WINDBG.EXE and SOS.DLL which has a command that lists the count, size, and type of objects in the managed heap. I am not familiar with using these tools for diagnosis, but you can read about some of the details under the .NET CLR Memory Counters section in the article below:
ASP.NET Performance Monitoring, and When to Alert Administrators:
http://msdn.microsoft.com/en-us/library/ms972959.aspx
Typically when something is not able to be done directly (like finding out exactly how much managed memory Session state is using) then it leads me to believe one might be looking in the wrong place or that the results would not yield anything of high importance. I think the better option might be to look at the server's memory use overall in relation to the aspnet_wp process.
Even if you found out you were dumping too much into Session what would you do as a result? You either need more memory, have to scale out the servers in the farm (but even then you have to implement a State Server so that server better have some power), or refactor the app not to place so much in Session. I think the metrics on overall memory usage from an ASP.NET standpoint is enough to justify which course of action to take.
And lastly there is some obvious thinking to this as well. Are you dumping 1,000,000 records into a DataSet that is in Session? That will take up some memory! Are you dumping a few simple data type values into session over each client? Probably not so bad, and if you are still having memory issues, it might be time to seek out the help of the IIS Foums folks because configuration issues could lead to poorly performing servers and have nothing at all to do with Session state or the .NET code you have written.
Hope this helps!