4

I have web application on IIS6 Win2003. This application connected to w3wp.exe process which reaches 50-70% of CPU after 3-4 minutes it was recycled ( forced one ). I have few places with Cache in this project so my questions concern the case if i set AppPool recycle limits and the process will recycle every few minutes to avoid high CPU overload unless i find what causing it which can take years ( heh )...

There are two types of Cache i'm using though the Web Application project, Output Cache and Cache.

What happens to two of those once i recycle application?

In case two of those deleted what should i do in order to keep those alive even if i recycle Application Pool ?

eugeneK
  • 10,750
  • 19
  • 66
  • 101

2 Answers2

6

The Cache is part of the application domain so recycling the Application Pool will invalidate all cache items.

This will also happen if you modify the web.config file or the bin folder.

Philip Smith
  • 2,741
  • 25
  • 32
  • thanks for the input but second question interests me much more than first one. – eugeneK Jul 19 '10 at 11:36
  • You cannot "keep them alive". Your code should check the cache to see if the items exist there or generate the cached items if not. This means that the first time your application is accessed it will be slower than subsequent accesses. There is no way round this. – Philip Smith Jul 19 '10 at 11:56
  • @ Philip Smith, unless i save Cache in external resource like MemCached for instance? – eugeneK Jul 19 '10 at 12:00
  • That would count as generating the cached items. – Philip Smith Jul 19 '10 at 21:04
1

you could look at out of process caching, that will survive app-pool restart and could be shared in a multi-node applications,

Have a look at Velocity (Microsoft AppFabric) or SharedCache (Opensource)

kay.one
  • 7,622
  • 6
  • 55
  • 74