views:

978

answers:

3

I have an ASP.Net website on IIS7 and I am planing to increase the MaxProcesses to match the number of cores on the server (4 cores, 64bit Windows Server 2008).

From what I read, if I increase the MaxProcesses to create a web garden I have to set an out-of-process state server, so I am planing to use the ASPState service to share sessions between worker processes.

But there is something that is not clear to me, is Caching also shared? Or do I have to set a new custom provider for the cache?

+1  A: 

Caching is not shared. The web garden creates multiple "w3wp" processes. Each process will have its own cache.

David
+2  A: 

If you want to share cache then use something like MemCached Win32 (with the Enyim cache client) or use the new MS product Velocity. This way once you move beyond one server you will already be set up architecturally to handle it.

Andrew Siemer
+2  A: 

In-process cache is never shared in a web garden.

But here's the REAL thing... I question the motivations behind what you're doing. If the object is to use your cores more efficiently, then you can just increase the number of request and/or worker threads you have running your ASP.NET application. Running multiple w3wp processes isn't necessarily the option you want. If you have some constrained resource, like an old in-process COM object that scales poorly with threads, then I can see how you might scale better with multiple processes. But unless you really know what you're doing and why, gently step back from that setting and leave it at 1. ;-)

Dave Markle
I consider increasing the number of processes as the natural option for improving the performance on the machine and as I am planing in the long run to span to multiple servers it will be a smoother step moving from a web garden and for that case I was considering the memcached provider.To be completely honest I didn't knew the option to increase the number of threads per worker processes, I thought it was handled as the proccess level.
rjlopes