Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net increase MaxProcesses (web garden) using state server and caching

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?

like image 445
rjlopes Avatar asked Dec 30 '22 17:12

rjlopes


2 Answers

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. ;-)

like image 153
Dave Markle Avatar answered Jan 13 '23 09:01

Dave Markle


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

like image 29
David Avatar answered Jan 13 '23 09:01

David