Caching - Controlling Output Cache Memory Usage?

May 17, 2010

I would like to use output caching with WCF Data Services and although there's nothing specifically built in to support caching, there is an OnStartProcessingRequest method that allows me to hook in and set the cacheability of the request using normal ASP.NET mechanisms.

But I am worried about the worker process getting recycled due to excessive memory consumption if large responses are cached. Is there a way to specify an upper limit for the ASP.NET output cache so that if this limit is exceeded, items in the cache will be discarded?

I've seen the caching configuration settings but I get the impression from the documentation that this is for explicit caching via the Cache object since there is a separate outputCacheSettings which has no memory-related attributes.

Here's a code snippet from Scott Hanselman's post that shows how I'm setting the cacheability of the request.

[code]....

View 1 Replies


Similar Messages:

Architecture :: Cache The Full List Of Objects In Http Cache On The Service Tier And Page In Memory?

Feb 25, 2011

We have a wfc layer that wraps the business classes and database access and use a client that lives on the database layer. Amongst our group we are attempting to form standards. Some want to have the client call the web method and pass the page they are requesting and the page size. Pass that to the database and then page in SQL Server use RowNum.Some want to cache the full list of objects in http cache on the service tier and page in memory. They concern here is memory use on the server.

Which would be best for a medium number of users with potentially large number of records to manage (say 30K) Is it better to cache them all in memory and work from there or page at the database as the application scales?

View 1 Replies

C# - Implement System.Web.Caching.Cache Object In A Controller To Cache Specific Query?

Mar 29, 2010

Is it correct to implement my caching object like this in my controller :

[code]....

And I Use it like this :

[code]....

View 1 Replies

Architecture :: Distributed Caching / Keeping Cache In Sync Between Multiple Webservers Or Even Better Farm Cache Management To Another Server?

Feb 26, 2010

I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.

This works great for session state but my next challenge is Cache

My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.

There are two challenges that I face

1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.

2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.

For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.

My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.

Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?

View 2 Replies

C# - How To Write Memory Usage Log

Nov 10, 2010

We got "out of memory" issue on production servers. What API can we use to get live memory (physical and managed) usage of the ASP.NET application?

PS: we're forbidden to profile memory with tools.

View 4 Replies

What Is Normal Memory Usage Of A Mvc Website

Feb 16, 2011

I have really tried to Google it but only articles about how to troubleshoot memory issues come up. Before I start to troubleshoot, I would like to know if my web site's memory usage is really abnormal or not.

So it is an asp.net mvc 2 website that runs on IIS 7.5 in production. I guess normal memory usage depends upon traffic, so here are the numbers of an average day:

300 unique visitor
400 visits
3000 page views

I would be really happy to get some idea how much is the normal memory usage for this traffic. Also I would be curious to know how memory usage normally increases with traffic growth.

View 1 Replies

Is Page Output Cache Stored In.NET Cache Object?

Nov 2, 2010

I need to enable caching in my asp.net application, but I do not want to use the webserver's memory for holding cache objects. If I add the page directive for output caching will the page be stored in the asp.net cache object?

View 2 Replies

Memory Usage In IIS Is FAR Greater Than In DevEnv - Is This Normal

Jan 5, 2011

I have an ASP.NET app that scrapes data from a handful of external pages, parses the relevant bits and displays them in a table. Total data retrieved is 3-4MB and the resulting page is about 1MB. I am using synchronous WebRequest GetResponse for the retrieval, but the same problem existed using an asynchronous BeginGetResponse/EndGetResponse process.There is no database access, no session storage, no caching, but an in-memory list of about 100 objects (total 1MB of data), plus a good amount of AJAX (AjaxControlToolkit). This issue appears on the very first run of the app, even if I have restarted IIS.

The issue:

When I run the app on my dev computer, the maximum commit charge is about 1.5GB. The biggest user, measured by Task Manager's VM Size, is WebDev.WebServer.exe (600MB). The app runs perfectly.

When I run it on my rent-a-server (IIS 7.5, 1GB RAM), the maximum commit charge is over 3.8GB. The biggest user is w3wp.exe at 2.7GB. IIS grinds to a halt and spits out a timed-out error page.

Given my limited server budget and the hope of having multiple simultaneous users, I'm kind of in a panic.

Is this normal? If I bump the server RAM up to 4GB, will that be enough?

View 3 Replies

Configuration :: IIS Memory Usage Is Extreme - Is That Normal

Jan 6, 2011

I have an ASP.NET 3.5 app that collects data from a handful of external pages, parses the relevant bits and displays them in a table. Total data retrieved is 3-4MB and the resulting page is about 1MB. I am using synchronous WebRequest GetResponse for the retrieval, but the same problem existed using an asynchronous BeginGetResponse/EndGetResponse process.

There is no database access, no session storage, but an in-memory list of about 100 objects/1MB of data, plus a good amount of AJAX (AjaxControlToolkit). This issue appears on the very first run of the app, even if I have restarted IIS.

The issue:

When I run the app on my dev computer, the maximum commit charge is about 1.5GB. The biggest user, measured by Task Manager's VM Size, is WebDev.WebServer.exe (600MB). The app runs perfectly.

When I run it on my rent-a-server (IIS 7.5, 1GB RAM), the maximum commit charge is over 3.8GB. The biggest user is w3wp.exe at 2.7GB. IIS grinds to a halt and spits out a timed-out error page.

Given my limited server budget and the hope of having multiple simultaneous users, I'm kind of in a panic.

View 3 Replies

Response - Finding Memory Usage During Download?

Jan 22, 2010

On an ASP.net site at my place of work, the following chunk of code is responsible for handling file downloads (NOTE: Response.TransmitFile is not used here because the contents of the download are being streamed from a zip file):

[code]....

I've just read about the 'buffer' property of the Response object. If I set that to false, will that prevent the Response.BinaryWrite() calls from buffering the data in memory? In general, what is a good way to limit memory usage in this situation? Perhaps I should stream from the zip to a temporary file, then call Response.TransmitFile()?

EDIT: In addition to possible solutions, I'm very interested in explanations of the memory usage issue present in the code above. Why would this consume far more than 1MB, even though Response.Flush is called on every loop iteration? Is it just the unnecessary heap allocation that occurs on every loop iteration (and doesn't get GC'd right away), or is there something else at work?

View 1 Replies

IIS And Ajax UpdatePanel Results In Extreme Memory Usage?

Nov 26, 2010

I have a update panel combined with gridview with sorting and paging.

I go into task manager to monitor the memory usage of the worker process (w3wp)

What I do is just click on the sort buttons rapidly.

With each click the memory of the process increases with about 2 mb

So I go from 30 mb memory usage to about 90. Then it stops at remains there, no memory is freed up. I am not using caching or session/application state.

What can be causing this, is there a setting in IIS to reduce the mem usage?

I also used .net profiler to examine my app memory usage: 4 mb, so what is the other 86 used for??? Even though it repots 4mb, in task manager it says 90 mb, so this leads me to believe that the rest is namanaged memory which must be used by IIS in some way.

View 2 Replies

Can Trap Memory Usage From Web Application When It Reaches A Certain Amount

Feb 3, 2011

I am hosting a solution with an outside company so getting them to troubleshoot or send me log files is not working.

Is there a way from code or Global.asax file that I can trap Memory usage from my web application when it reaches a certain amount? Then figure out what is using all the memory

View 2 Replies

C# - Page Explodes Memory Usage To 80MB And Then Dies?

Feb 25, 2011

I'm using asp.net and chrome and the page becomes unresponsive after a while. When I look at the chrome debug, I see that memory usage increases to about 80MB and chrome popups a request to kill the page. The error counter spins and generates about 30,000 errors when the popup comes. What triggers the error is the call of an updatepanel. The error as displayed in chrome is "Failed to load resource".

The update panel: the user clicks on a button and the panel is refreshed. There's only one update panel on the page.

This is what I have:

function HistoryUIActions() {
$('.SelectDay, .SelectDay1Digit').click(function () { GetNewDate(this); });
};
function GetNewDate(thedateitem) {
var TheDay = $.trim($(thedateitem).html());
TheYear = 2011;
ThisMonth = 2;
DateString = ThisMonth + '/' + TheDay + '/' + TheYear;
__doPostBack('<%= TheUpdatePanel.ClientID %>', DateString);
};
function EndRequestHandler(sender, args) {
HistoryUIActions();
};

The errors compound on every postback: 1,4, 11, 26, 57, 120, 247.... eventually chrome kills the page. When I put a breakpoint in the function, it stops the code just after I press the button; then after it hits the __doPostBack line, it starts the GetNewDate function again several times by going back to the line of the click event, apparently executing it the number of times shown above.

View 1 Replies

Web Forms :: Get Load Information On Application Server In Terms Of Memory Or CPU Usage?

Feb 11, 2010

Is there a way to get load information on Application Server? How much memory or CPU is being used at a given point? I want to either 1. Limit users to use specific functionality of ASP.NET 3.5 application or 2. Deny users from accessing the application saying "Server is busy at the moment"

View 4 Replies

Web Forms :: Memory Usage (consumption) Of Individual Controls On A Web Form Shown In A Browser?

Oct 12, 2010

Is there a way to check the memory usage (consumption) of individual controls on a web form shown in a browser. Like Repeater Control, Multiline Text box etc. The reason is I am putting the repeater control in session and checking the status of controls, based on which I am doing further actions.

View 2 Replies

Sql - Cache And Output Cache For Controls?

Oct 28, 2010

You know I have the way to Cache the data I've got from the SQL Server over data caching. In addition I can output cache web user controls.Whats about a web user control contains data from a SQL database? Does it make sense to cache the data and also cache the control?What is the best solution for the combination of these two components?

View 1 Replies

Environment.WorkingSet Incorrectly Reports Memory Usage For A Website That Runs On Windows 2003 Server

Jul 31, 2010

Environment.WorkingSet incorrectly reports the memory usage for a web site that runs on Windows 2003 Server.(OS Vers: Microsoft Windows NT 5.2.3790 Service Pack 2, .NET Vers: 2.0.50727.3607)

It reports memory as Working Set(Physical Mem.): 1952 MB (2047468061).

Same web site runs locally on Windows Vista with a Working Set(Physical Mem.): 49 MB (51924992).

I have limited access to the server and support is so limited.

so i have computed the total memory by traversing with VirtualQuery.

Total of pages with state: MEM_FREE is 1300 MB.

(I guess server have 4 GBs of RAM and PAE is not enabled, max user mode virtual address is 0x7fff0000.)

So, i know working set is not only about virtual memory. But, is it normal to have such a high working set while its very low on another machine?

View 2 Replies

C# - How To Exceed The 60% Memory Limit Of IIS7 In Caching Application

Jun 11, 2010

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:

The amount of memory the object consumes seems to be far in excess of our 10GB calculation. 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.

[URL]

View 1 Replies

MVC :: Output Caching For Several Client IP's

Apr 7, 2010

I have a page with outputcache right above the action in a controller class. What I want is to disable this outputcache for myself. Can it be done by IP?

Something like that: [OutputCache(Duration = 60, VaryByParam = "None", IgnoreIP = "100.100.100.100")]

View 6 Replies

C# - Find Out How Much Memory Is Currently Consumed By Cache

Nov 8, 2010

I'd like to modify the value of my Sliding Expiration time span based on how much memory is available. If the site's traffic is high at any point in time, more data will be added to the cache than during quieter periods. During those quiet periods I can increase the sliding expiration time span, thus allowing data to be stored longer. But when the site is busy I need to free up memory so I'm happier with a shorter time span.

So I guess my questions are as follows: Is it possible for me to find out how much memory is being consumed by the items I've added to HttpRuntime.Cache? If so, how? Does this sound like a realistic solution to the problem I've described?

View 1 Replies

MVC :: Output Caching And Query Dependency?

Sep 21, 2010

I plan to use output cache for my page and also specify sql dependencyi succeded in doing it the following way

[Code]....

Suppose if i want to implement a dependency on the sql query , i create an sqlcache dependency object and specify the sql command to it.Set the notifications .But how do i add this sqldependency to the output cache?For example: if i need to add a file dependency, i give something like Response.AddFileDependency ("filepath"); is there any similiar command available for sqldependency as well? I'm confused about this because, most of the examples i've looked into, does a cache.insert , which defeats my purpose as it's object caching and not output caching. In a nutshell, is it possible to attach a sqlcachedependency to o/p cache inside the controller action

View 3 Replies

Output Caching On Static Pages?

Jan 28, 2010

Does output caching help boost the performance of asp.net mvc pages that just consist of html, css, images, and javascript?

View 1 Replies

Web Forms :: User Control Output Caching?

Jan 11, 2010

I have a user control (say PricingGrid.ascx) which generates a pricing grid on a given product's page. I pass the user control 2 parameters : currencyId and productId. The user control has output caching specified by

[Code]....

I am adding PricingGrid.ascx to my page programatically, i.e. using LoadControl [URL]If the user changes their currency and refreshes the page, the cached version of their original currency is still showing, until the 60 seconds expires. Is there any way to force the page to check :1) Does a cached version of PricingGrid.ascx with their new currency exist?2) If so, retrieve that version, and if not, create that version.If I output all the keys in the Page.Cache object on PageLoad, I'm not seeing my user control in the output.

View 3 Replies

Output Caching In HTTP Handler And SetValidUntilExpires?

Jun 8, 2010

I'm using output caching in my custom HTTP handler in the following way:

public void ProcessRequest(HttpContext context)
{
TimeSpan freshness = new TimeSpan(0, 0, 0, 60);
context.Response.Cache.SetExpires(DateTime.Now.Add(freshness));
context.Response.Cache.SetMaxAge(freshness);
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetValidUntilExpires(true);
...
}

It works, but the problem is that refreshing the page with F5 leads to page regeneration (instead of cache usage) despite of the last codeline:

context.Response.Cache.SetValidUntilExpires(true);

UPD: Seems like the cause of problem is that HTTP handler response isn't caching on server. The following code works well for web-form, but not for handler:

Response.Cache.SetCacheability(HttpCacheability.Server);

Are there some specifics of the caching the http handler response on server?

View 2 Replies

State Management :: Using SqlCacheDependency With Output Caching?

Apr 9, 2010

Iam adding SqlCacheDependency programmatically but Iam not able to invalidate the cache.

Iam using the following Output cache directive in the .aspx page

[Code]....

The code in the .aspx.cs file is:

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved