Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for memory limits in an IIS app pool

Tags:

memory

iis

I wanted to know what people used as a best practice for limiting memory on IIS [5/6/7]. I'm running on 32bit web servers with 4GB of physical memory, and no /3GB switch. I'm currently limiting my app pools to 1GB used memory. Is this too low? any thoughts?

like image 275
jwmiller5 Avatar asked Dec 08 '08 17:12

jwmiller5


People also ask

How do I limit the application pool memory in IIS?

Go to Tools & Settings > IIS Application Pool:Recycling at regular time intervals (minutes) Recycling when the maximum number of requests is reached. Recycling when the maximum amount of virtual memory is used. Recycling when the maximum amount of private memory is used.

What is application pool memory limit?

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.

How do I limit CPU usage in application pool IIS?

In IIS 8.0, set limit in 1/1000ths of one percent in the CPU pane of IIS Manager. For both cases, the limit attribute in applicationHost. config is in 1/1000ths of one percent. The default value is 0 , which disables CPU limiting.


2 Answers

All the limits in the application pool are for bad behaving apps. And more specifically:

  1. To prevent the bad app from disturbing to good apps.
  2. To try and keep the bad app running as much as possible.

In that light, the answer is of course: It depends.

If your application is leaking then without a limit it will crash around 1.2 - 1.6 Gb (if memory serves). So 1 Gb is sensible. If during normal operation your application consumes not more than 100 Mb and you have many app pools on the server, than you should set the limit lower to prevent one app from damaging other apps.

To conclude: 1 Gb is sensible. Hitting the limits should be treated as an application crash and should be debugged and fixed.

David Wang blog is a good resource on those issues.

like image 177
Igal Serban Avatar answered Nov 15 '22 20:11

Igal Serban


There's a great writeup from a MS Field Engineer about this subject.

like image 20
jwmiller5 Avatar answered Nov 15 '22 19:11

jwmiller5