Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Worker Process on Windows Server 2012 Memory Limit

Tags:

c#

asp.net

iis

I have an ASP.NET 4.0 application running on IIS hosted under a Windows Server 2012 with 8 GB total physical memory.

I noticed that the IIS Worker Process size is considerably increasing as users are logging into the application and performing their tasks.

I'm really lost on how to setup this application in order to avoid memory outage or application crash.

My question is, what is the maximum size the IIS Worker Process can reach on a Windows Server 2012 with 8GB RAM?

Do you advise me to run the Application Pool in 32-bit mode or 64-bit mode?

Do you advise me to use Web Gardening (Increase the number of IIS Worker Processes) ? What are the side-effects of using this option?

like image 848
Mohammad Mahjoub Avatar asked May 08 '15 16:05

Mohammad Mahjoub


People also ask

How much memory should an IIS worker process use?

A healthy IIS Server will consume approximately 300 - 600 MB, maybe 700 MB RAM when busy. When it uses more than 700 MB RAM, it's telling you that: You have a lot of concurrent web users.

How do I increase IIS memory worker?

Right-click the WsusPool and choose Advanced Settings. When the Advanced Settings window opens up find the Recycling section near the bottom. Change Private Memory Limit (KB) to a higher number that fits your server specifications or '0', which means no limit, instead of the hard-coded 1843200. Hit OK.

Which IIS worker process is consuming more memory?

In general, high memory is when your ASP.NET worker process (Aspnet_wp.exe) or Internet Information Services (IIS) worker process (W3wp.exe) memory is consistently increasing and isn't returning to a comfortable level.

What is private memory limit in IIS?

Private memory is the maximum amount of memory (in KB) a worker process can consume before causing an application pool to recycle. Private Memory restricts web applications from consuming more memory than the assigned limit. Default application pools have private memory of 0 KB, which means there is no limit.


1 Answers

The question is quite broad, but I think it can be partially answered.

  1. Possible memory leaks - if the w3wp process memory (Commit Size or Memory) continues to rise, even if the number of users does not increase anymore, than you may leak memory. Check this question for more details

  2. Application pool memory limit - maximum allowed memory for a worker process can be configured per application pool -> Recycle conditions -> Memory Based Maximums. When this memory limit is reached, the application pool is recycled (a shutdown event is sent and the actual shutdown is performed after Shutdown Limit (90 seconds by default))

  3. No application pool memory limit - in this case, I think the limit will depending on how much memory a .NET process can allocate on your specific architecture. Using information from here, in your particular case, the memory limit should be 70% of RAM + Pagefile.

However, if memory usage is high, you should also take into consideration the following:

  • Garbage collection - when memory usage is rather high and GC steps in, desperately to reclaim the memory, application performance may degrade very much
  • Memory consumption concurrents - if you have other processes that require lot of memory (e.g. Reporting Server), you should consider explicitly setting upper memory limits for your application pool
  • How to check if application pool was shutdown due to memory limit - Not entirely sure, but I think that HostingEnvironment value is sent as a reason when application pool is recycled due to memory max reach. Check this answer to see how to wire up things in your application to catch application pool shutdown initiation.
like image 108
Alexei - check Codidact Avatar answered Sep 28 '22 02:09

Alexei - check Codidact