How can I exceed the 60% IIS7 memory limit in an ASP.NET caching application

Sorry if this is more serverfault and stackoverflow. It seems to be on the border.

We have an application that caches a large amount of product data for an e-commerce application using ASP.NET caching. This is a dictionary object with 65K elements, and our calculations set the object size to ~ 10 GB.
Problem:

  • The amount of memory consumed by the object, apparently, far exceeds our calculations of 10 GB.

  • BIG CONCERN: We cannot use more than 60% 32 GB on the server.

What we have tried so far:

In the machine.config / system.web file (sf does not allow tags, forgives formatting):

processModel autoConfig="true" memoryLimit="80" 

In web.config / system.web / caching / cache (sf does not allow tags, forgives formatting):

  privateBytesLimit = "20000000000" (and 0, the default of course) percentagePhysicalMemoryUsedLimit = "90" 

Environment: Windows 2008R2 x64 RAM 32 GB IIS7

It seems that we cannot exceed 60%. See a screenshot of the assignment.

http://www.freeimagehosting.net/image.php?7a42144e03.jpg

+6
source share
2 answers

A little late, but I have almost the same problem. The problem with the memoryLimit parameter in processModel is that it simply does not work, despite the fact that it is documented as such.

percentagePhysicalMemoryUsedLimit looks like it should do something, but has no effect.

privateBytesLimit="20000000000" really works. I went and debugged the process and found the CacheMemorySizePressure object, and it successfully took the value and set it to _memoryLimit. I would double check this.

Another option is to set the threshold for restarting the use of private memory in the IIS application pool. This should also be raised and removed by default by 60%.

The third option uses the new MemoryCache class and sets PhysicalMemoryLimit for it.

+2
source

Have you considered using a different caching strategy? Built-in caching is not all that rich, and you will try your best to get it to do much more (if some IIS guru does not have smart work).

We spent a lot of time on it and gave up. We actually use thinner objects to store in the cache and get more complete objects as needed.

When we needed to consider this, we explored Memcached and Velocity, but backtracked on their deployment. They are richer though.

Also, how do you store items in cache through code? Do you put them there when you start the application or after the first request for each? The reason why I ask is whether your cache keys are effective, and that you often populate the cache and not extract anything (it can be only one type of object). We managed to do this once, adding time to the key to a specific date, for example.

+1
source

All Articles