Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I exceed the 60% Memory Limit of IIS7 in ASP.NET Caching application

Pardon if this is more serverfault vs. 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 put the object's size at ~10GB.
Problem:

  1. The amount of memory the object consumes seems to be far in excess of our 10GB calculation.

  2. BIGGEST CONCERN: We can't seem to use over 60% of the 32GB in the server.

What we've tried so far:

In machine.config/system.web (sf doesn't allow the tags, pardon the formatting):

processModel autoConfig="true" memoryLimit="80"

In web.config/system.web/caching/cache (sf doesn't allow the tags, pardon the formatting):

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

Environment: Windows 2008R2 x64 32GB RAM IIS7

Nothing seems to allow us to exceed the 60% value. See screenshot of taskman.

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

like image 914
evilknot Avatar asked Jun 11 '10 03:06

evilknot


1 Answers

A little late but I'm having nearly the same issue. The problem with the memoryLimit setting on processModel is that it just seems to have no effect despite being documented as such.

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

privateBytesLimit="20000000000" does work though. I went and debugged the process and found the CacheMemorySizePressure object and it successfully picked up the value and set it to _memoryLimit. I would double check that.

Another option is setting a Private Memory Usage recycle threshold on the IIS app pool. That should also get picked up and override the default 60% limit.

A third option is using the new MemoryCache class and setting the PhysicalMemoryLimit on it.

like image 72
RandomEngy Avatar answered Sep 30 '22 21:09

RandomEngy