简体   繁体   中英

IIS Worker Process on Windows Server 2012 Memory Limit

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM