ASP.NET缓存和W3P内存使用情况 [英] Asp.net caching and w3p memory usage

查看:47
本文介绍了ASP.NET缓存和W3P内存使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Web应用程序将图像存储在数据库中.

Web application storing images in database.

在我们的第一个设置中,我们存储(并提供)来自asp.net缓存中调整大小的数据库中的图像.一切都很好,但是随着Web越来越受欢迎,我们开始遇到怪异的问题,怪异的是,我的意思是怪异的-从无任何详细信息的w3p崩溃到每天两次无处不在的随机OutOfMemoryExceptions.

In our first setup we were storing (and serving) from images from database resized in asp.net cache. This was all good, but as web started getting more and more hits, we started experiencing weird problems, and by weird, I do mean weird - ranging from w3p crashing without any details to random OutOfMemoryExceptions occurring everywhere couple of times a day.

我怀疑我们这里可能滥用了asp.net缓存,因此我重写了图像缓存以转到文件系统.我们的图像处理程序现在检查缓存目录中是否有调整大小的图像,如果不存在这样的图像,则从数据库中获取该图像并将其保存在缓存目录中,然后从那里进行服务.

I suspected that asp.net cache may be misused by us here, so I rewrote image caching to go to filesystem. Our image handler now checks for resized image in cache dir, if no such image exists, fetches it from database and saves it in cache dir, and serves it from there.

困扰我的是该网站的w3p内存使用情况.以前,当我们使用asp.net缓存对象时,w3p的典型内存使用量约为600mb.现在,当处理程序从文件系统提供图像时,典型的内存使用量约为750mb.我以某种方式期望它下降(至少一点点),但绝对不会上升.有什么解释吗?

The thing that's bothering me is memory usage of w3p for this web site. Before, when we were using asp.net cache object, typical memory usage for w3p was around 600mb. Now, when handler serves images from filesystem typical memory usage is around 750mb. Somehow I expected it go down (at least a bit), but definitely not up. Is there any explanation for this?

第二,有没有一种方法可以检查w3p进程以查看用于什么的内存量?我想到的一件事是性能计数器,但还没有时间检查一下.

Second, is there a way to inspect w3p process in order to see how much memory is used for what? One thing that comes to mind is performance counters, but haven't had the time to check it out.

推荐答案

这只是我的推测,但是如果文件I/O被缓冲,那会不会占用很多内存?可能比ASP缓存更重要,因为提供的每个文件都需要一个缓冲区,而不是从缓存中获取共享资源.

This is just speculation on my part, but if the file I/O is buffered, wouldn't that use a lot of memory? More so perhaps than the ASP cache as each file served up requires a buffer instead of taking a shared resource from the cache.

对于内存分析,有许多探查器程序可以用来分析正在发生的事情.

As for memory profiling, there are a number of profiler programs out there you could use them to analyse what's going on.

这篇关于ASP.NET缓存和W3P内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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