sexta-feira, novembro 30, 2012

IIS Recycle automático


Como configurar limites de memória nas APP Pools do IIS

Sempre que se configura um site de IIS é conveniente proceder à limitação da memória em uso por essa AppPool de forma a que sempre que ultrapassar esse limite vai forçar a matar os processos pendentes desse site, ou seja, matará falhas derivadas de erros de programação como processos que não têm o kill correpondente e ou não é feito o recycle dentro da própria aplicação/site.

========================================================

The same setting hasn't been changed since IIS 6.0.

In IIS mmc, click Application Pools. Right-click a pool and select Advanced
Settings. In Recycling section, you will see there are two settings:
Private Memory Limit (KB) and Virtual Memory Limit (KB) .

When any of these 2 settings are set, if the worker process exceeds the
private or virtual memory quota, IIS will recycle that pool which limits
the memory usage.


========================================================

Dificuldades já conhecidas:

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 off 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 consume not more the 100 Mb and you have many app pool 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 application crash and debugged and fixed.

Want to learn more:

http://blogs.msdn.com/b/pfedev/archive/2009/01/22/memory-based-recycling-in-iis-6-0.aspx


Sem comentários: