IIS 7 over time performance degrading when rendering partial views - asp.net-mvc

I have several websites that are currently experiencing the following problem. Over time, rendering of a specific partial view (asp.net mvc 1) will degrade, and take around ten times longer than it does normally. I currently have a workaround, but it's far from ideal.
Take this node off our load balancer
Stop IIS
Delete all temporary asp.net files
Start IIS
Hit the site to get caches populated and views compiled
Put the node back on the load balancer's rotation.
I know that it's not the restarting of IIS fixing it, it seems that the temp asp.net files have to be deleted for this to work properly. After those steps are completed, performance on the site is much, much better for around three to six hours. After that, it goes back to being terrible. The partial view that's having issues pretty much just renders out some html with cached data. We have not been able to reproduce this issue in our dev environment at all, so we're pretty stumped. We're going to be upgrading our live environment shortly, so I'd just like to know what's causing this problem. If it's configuration related at all, I want to make sure it's fixed with our new setup. Anyone ever seen this before?

There could be many things at play here, an initial check list
confirm app is not deployed in debug mode
what logging do you use and is it being done excessively?
what is the bottleneck on the server when this happens? memory? then you might have to check for a leak
do you regularly recycle your app pools?
Can you give some more details on what this partial view actually does?

The solution for this problem was to clean up the temporary asp.net files. We integrated this step into our deploy process, and the site overall has been running faster.

Related

EPiServer Output Cache clearing for no reason

We recently put live EPiServer output caching, this works fine locally and on our staging sites. For some reason since going live yesterday pages don't seem to stay in the cache for long, if at all. I can't see any obvious reason for this aside from genuine traffic?
To implement caching I added [ContentOutputCache] to the get methods of certain controllers. Then updated the Application Settings with the following:
uiUrl="~/EPiServer/CMS/" httpCacheExpiration="12:0:0" httpCacheVaryByCustom="path" httpCacheVaryByParams="id,epslanguage"
Has anyone seen anything like this before. I can't figure out why the cache keeps being dropped. Interestingly chrome tells me that the content is coming from the cache but the page load time is upwards of 20 seconds at times ... other times it's instant (when the caching is working).
I am not logged in to the CMS and no one is publishing anything.
Please let me know if you need any more info as always any help greatly appreciated on this.
Thanks,
Dan

Why is my website images are swapping and the page is hanging on iPhone web browsers only?

I have a website written in ASP.NET MVC (Razor). Recently, a few days ago the images on the website started swapping all over the place. When refreshing the site, it might just hang for quite some time or load all images correctly. So I plugged my iPhone to my Mac and used the web inspector to see whats going on. I found out that at the time of load the browser hangs on certain files. These files are either images or js libraries. The images are very small. Less then 10kb so it is not the size of the image.
This issue only happens on iPhones. I checked on several iPhones.
I have tried multiple Android devices, Mac and Windows computers and they all load fast and every image is in the right place - no issues.
I researched a bit and found out some interesting references to HTTP Pipelining. But if that was is the case, why would these issues start now?
I do not know what to thing anymore.
What am I trying to understand is why would that only happen on the iPhone?
Thank you,
Any clue would be appreciated.
I had the same issue. After months of breaking my head I decided to implement lazy load on all images. After that, swapping never occurred.
Page hanging could happen because of multiple reasons. I would definitely check the code again and in particular look for the way you handled unmanaged resources. More on unmanaged resources

Am I missing potential problems with custom page caching in Rails 3?

I use rails to present automated hardware testing results; our tests are run mainly via TCL. Recently, we have implemented a "log4TCL" which is basically a translated version of log4J. The log files have upwards of 40000 lines, each of which is written to the database as a logline record, and load time for the view is too long to be considered usable. I have tried to use ajax requests to speed things up, but the initial query/page load accounts for ~75% of the full page load.
My solution is page caching. I cannot use the rails included page caching because each log report is a different instance of "log_viewer". The report is generated using a test_run_id parameter. Rails-included page caching only caches one instance of "log_viewer.html". What I need is "log_viewer_#{test_run_id}.html". I have implemented a way of doing this. The reports age out after one week and are purged from the test_runs/log_viewer_cache directory to save disk space. If an older report is needed, loading the page re-generates the report with a fresh age-out timer.
I have come to the conclusion that this is the way to go. My concern is that I have not found any other implementations such as this anywhere which leads me to believe that I have missed an inherent flaw in my design. Any input would be much appreciated.
EDIT: For clarification, the "Dynamic" content of this report is what takes too long to load. I need to cache multiple instances of what action/fragment caching is not concerned with.

ASP.NET MVC Instability

Got a slightly odd one here.
We have an MVC site that is experiencing some instability. Once a week for the last couple of weeks the site has gone down. We have found that all we need to do to bring the site back up again is 'touch' the web config file (i.e. open it and save it, with no changes). This brings the site back to life immediately and keeps it alive for another week or so.
The site has custom error pages set up so we can't actually see the error that is being thrown, and there is nothing appearing in the IIS logs.
It looks like some kind of memory leak problem, however .NET garbage collector should manage this, right?
Any ideas?
Thanks,
Pat
You should have some kind of logging so that you can see what error you get. I usually use elmah. That will give you the full error message and stack trace. It's pretty hard to say what the problem is without knowing the error. But it can be a memory leak of some kind. Do you use a lot of unmanaged code? The garbage collector can't handle everything.
Touching the web.config forces recompilation and refreshes the app pool. My guess is something is knocking out your app pool, whatever it is will be in the event logs, i suggest you check there.

Cassini much slower than IIS for MVC RenderPartial

I have an MVC view with a partial view recursive call that displays hierarchical data.
The complete tree typically includes in the order of 500 or so items.
The data is all included in the model, and the model's a trivial record class - nothing in it except auto-properties.
In IIS this works fine.
However in Cassini/WebDev (Visual Studio's built in web server) this page runs painfully slow and often times out.
A little digging shows that this is due to each call to Html.RenderPartial taking around 200ms (or 1/5 of a second). The actual partial view seems to take under a millisecond or so.
Anyone got any ideas why this is so slow?
Why would it be different between IIS and Cassini? The IIS application is pointed at my development directory; they're running exactly the same code, build and config.
I think this could be related to the caching of view resolved paths. The article here explains the issue to which I am referring.
Do you notice the same behaviour if you pass the full path of the view, like:
RenderPartial("~/Views/MyView.ascx")
Kindness,
Dan

Resources