Cache Isolation Level (InProc/OutProc)
If your application is running on a server node (the node that is participating in the cluster), you can access the cache either as InProc or OutProc. For InProc, cache lives inside your application process and performs all the clustering operations from there. For OutProc, you have to start the cache independently and then connect to it. Both access modes have their own pros and cons.
InProc mode in a replicated cache can give you really fast GET operations since you are accessing all the data from within your own memory space. However, since your application and the cache are sharing the same memory, you may face memory size limitation (in terms of how much you can cache).
Similarly, OutProc has benefit that multiple applications on the same machine can share a common cache. Additionally, since the cache lives in its own memory, you have more memory available to you. But, there is an overhead of transferring data between your application process and the NCache process.
OutProc requires that your .NET Assemblies (the ones that contain the objects
you are going to add into NCache) are either registered in GAC or are located at
%NCHOME%/bin/service folder. Otherwise, NCache will not find your object
definitions which it requires for .NET Serialization. And, this will result in
NCache throwing an exception when you do Add, Insert, Get, or Remove operations.
If you are running NCache in a clustered configuration, you must ensure this on all machines in the cluster. By default, all caches are OutProc but isolation level can be changed for caches of local topology. It can be done in the following way.
Using NCache Manager
Click on the cache name in Cache Explorer to open cache settings.
Go to Main tab.
Change the cache Isolation Level as per your requirement.
Right click on cache name in Cache Explorer and select Apply Configuration option.
you can specify the attribute value of
inproc as true (for InProc)
or false (for OutProc):
<!-- myreplicatedcache will start in inproc mode --> <cache-config name="myreplicatedcache" inproc="true" config-id="8" last-modified="7/31/2010 3:53:53 PM"> <!-- mypartitionedcache will start in outproc mode --> <cache-config name="mypartitionedcache" inproc="false" config-id="1" last-modified="6/20/2010 3:50:34 PM">
InProc mode is only available for Replicated and Local cache.