How can I get the breakdown of memory taken by aspnet_wp?

S

Stan

There was a number of postings about aspnet_wp worker
process taking too much memory and eventually choking the
webserver.

One issue is still not clear to me - how can I narrow it
down to an application that is a culprit?

Suppose, there are three applications on the webserver and
each of them uses db connections and caching. I have not
found a way in PerfMon to see how much memory each of
those apps take.

Is adplus and other tools the only answer?

Thanks,

-Stan
 
C

Curt_C [MVP]

Depends on the OS/IIS you are using. If you have 2003/IIS6 you can setup
each with it's own app pool and declare the amount of memory it's allowed to
have. (P.S. I love this feature).
 
S

Stan

No, it is on Win2k/IIS5
-----Original Message-----
Depends on the OS/IIS you are using. If you have 2003/IIS6 you can setup
each with it's own app pool and declare the amount of memory it's allowed to
have. (P.S. I love this feature).

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com





.
 
S

Steven Cheng[MSFT]

Hi Stan,


Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, you're looking for some approachs to limit the max
memory each ASP.NET worker process will take since you always found the
worker process taking too much memory and eventually choking the webserver.
If there is anything I misunderstood, please feel free to let me know.

Based on my research, in ASP.NET runs with IIS5 enviroment, we can set the
worker process's features via the "processModel" element in the
machine.config file. The "processModel" element is like below:

<processModel enable="true" timeout="Infinite" idleTimeout="Infinite"
shutdownTimeout="0:00:05" requestLimit="Infinite" requestQueueLimit="5000"
restartQueueLimit="10" memoryLimit="60" webGarden="false"
cpuMask="0xffffffff" userName="machine" password="AutoGenerate"
logLevel="Errors" clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect" comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00" maxWorkerThreads="20"
maxIoThreads="20"/>

the "memoryLimit" is the certain attribute which control the maximum
allowed memory size of a ASPNET worker process
here is the description in MSDN:
-----------------------
memoryLimit: Specifies the maximum allowed memory size, as a percentage
of total system memory, that the worker process can consume before ASP.NET
launches a new process and reassigns existing requests. The default is 60
percent.
-----------------------
For the detailed info on other attributes in the "processModel" setting ,
you can view the following reference in MSDN:
#processModel configuration
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfprocessmodelsecti
on.asp?frame=true

And for ASP.NET with IIS5 , use the "processModel" setting to control a
APS.NET application process, the memory limit is controled by percent (not
a absolute memory size value). However, this has been improved in the IIS6
where we can use the "Applicaion pool setting" to configure the ASP.NET
application process feature. It provide some new feature such as setting
the maximum memory limitation by absolute memory size(not percent value).
For detialed info on the "Application pool setting" , you may view the
following tech article in MSDN:

#IIS6 Web Application Pool Settings
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconrecyclingapplicati
onpoolsettings.asp?frame=true

Also, I've found some reference on the ASP.NET web application's
performance Monitoring:
#ASP.NET Performance Monitoring
http://msdn.microsoft.com/library/en-us/dnaspp/html/monitor_perf.asp?frame=t
rue

Hope they're helpful to you. If you have anything unclear or need any
further assistant, please feel free to post here.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Stan

Steven,

There are several ASP.NET applications running on the web
server.

aspnet_wp takes too much memory

I need to know how much memory each of those applications
takes in order to start isolating the problem.

How can I do that?

Thanks!

-Stan
 
S

Steven Cheng[MSFT]

Hi Stan,

Thanks for your response. The suggestion I provided in the last reply:
"processModel" element in machine.config is used to set the ASP.NET's
process attributes. As for the question you mentioned : "know how much
memory each of those applications takes", I think what you need is an
approach to monitor those ASP.NET worker processes's status(especially the
memory volume each one has taken), yes? Please feel free to correct me if
my understanding is not quite exact for your request.

I've searched some further reference on the ASP.NET worker process's
monitoring. I found the "ProcessInfo" and "ProcessModelInfo" classes in
dotnet framework maybe helpful to you, here is part of their structure:
public class ProcessModelInfo
{
public static ProcessInfo GetCurrentProcessInfo();
public static ProcessInfo[] GetHistory(int num);
}

public class ProcessInfo
{
public TimeSpan Age { get; }
public int PeakMemoryUsed { get; }
public int ProcessID { get; }
public int RequestCount {get; }
public ProcessShutDownReason ShutdownReason { get; }
public DateTime StateTime { get; }
public ProcessStatus Status { get; }
}

The ProcessModelInfo class have static method "GetCurrentProcessInfo()" to
get the a ProcessInfo structure which contains the current ASPNET
workerprocess's status info. Also, we could see there is the "PeadMemory"
attribute in the
ProcessInfo class, here is the description of this member in MSDN:
--------------------------------------------------------
ProcessInfo.PeakMemoryUsed Property

Gets the maximum amount of memory the process has used.

Property Value
The maximum memory used (in kilobytes [KB]).

Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
----------------------------------------------------------
If you want more info on the ProcessInfo class, you can view the following
section in MSDN:

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebProcessInfo
ClassTopic.asp?frame=true

Also, I've found a tech article which instruct us how to use the two
classes and create a custom httpHandler to monitor the worker processes run
in a certain ASP.NET web application. I believe it maybe helpful to you:

# How to Watching Your Server Processes
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnet-watchserverproces
ses.asp?frame=true

Please check out the preceding items. If you have any questions or need any
further assistant, please feel free to post here. I'll try my best to help
you.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top