How to determine the size in bytes of ASP.NET cache?

I am actively developing an ASP.NET web application that uses server-side caching, and I'm trying to figure out how I can control the size of this cache during some kind of large-scale testing. The cache stores XML documents of various sizes, some of which are several megabytes.

On System.Web.Caching.Cache object System.Web.Caching I see a variety of properties, including the Count , who receives "the number of items stored in the cache" and EffectivePrivateBytesLimit , who receives "the number of bytes available for the cache." Nothing tells me the size in bytes of the cache.

In the Understanding Caching Technologies section of the .NET Framework Application Caching Guide, there is an Object Cache Management with a table (Table 2.2: Application Performance Counters for Cache Monitoring) that lists a set of application performance counters, but I don’t see no data that give me the current cache size.

What is a good way to find the size of this cache? Should I set a limit on bytes in the cache and look at one of the revolutions? Am I thinking about this problem wrong? Answer to How to determine the total ASP.Net cache size is really the best way to go?

+3
source share
1 answer

I was going to give a less detailed report on the answer that you refer in your question until I read this. I would like to direct you to this, it seems, it seems to me. No better than viewing the physical size on the server; everything else may be inaccurate.

You might want to set up monitoring , for which a PowerShell script might be more convenient to write and send to yourself in a report. Thus, you can run various tests in one night by stating and summing them up.

, . , . , .

+1

Source: https://habr.com/ru/post/1717512/


All Articles