如何确定ASP.Net缓存的总大小? [英] How to determine total size of ASP.Net cache?

查看:332
本文介绍了如何确定ASP.Net缓存的总大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是在Web项目中的ASP.net缓存和我正在写一个状态页面,这其中显示有关,因为我能找到缓存在缓存中的项目,尽可能多的统计数据。有什么办法,我可以得到缓存数据的总大小(以字节为单位)?每个项目的规模将更加美好。我想在网页上显示这一点,所以我不认为我可以使用性能计数器。

I'm using the ASP.net cache in a web project, and I'm writing a "status" page for it which shows the items in the cache, and as many statistics about the cache as I can find. Is there any way that I can get the total size (in bytes) of the cached data? The size of each item would be even better. I want to display this on a web page, so I don't think I can use a performance counter.

推荐答案

我在看我的表现监视器下的 ASP.NET应用V2.0.50727 类,我有以下缓存相关的计数器:

I am looking at my performance monitor and under the ASP.NET Apps v2.0.50727 category I have the following cache related counters:

缓存%计算机内存限制使用

缓存%进程内存限制使用

还有很多其他高速缓存相关的指标的这一类。

There are also a lot of other cache related metrics under this category.

这应该能够让你的百分比,那么如果你能得到的总允许用 Cache.EffectivePrivateBytesLimit 或其他一些叫你应该能够弄清楚。我没有与这些计数器的亲身经历,所以你将不得不做一些研究和试验验证。

These should be able to get you the percentage, then if you can get the total allowed with Cache.EffectivePrivateBytesLimit or some other call you should be able to figure it out. I do not have personal experience with these counters so you will have to do some research and testing to verify.

下面是从性能计数器读快速启动文章:
<一href=\"http://quickstart.developerfusion.co.uk/quickstart/howto/doc/PCRead.aspx\">http://quickstart.developerfusion.co.uk/quickstart/howto/doc/PCRead.aspx

Here is a quick start article on reading from performance counters: http://quickstart.developerfusion.co.uk/quickstart/howto/doc/PCRead.aspx

这篇关于如何确定ASP.Net缓存的总大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆