Experiencing slow first time loads with Web Apps on Azure - asp.net-mvc

I'm experiencing very slow load time (~10sec) for the first time a page is loaded by a browser. Once the page has loaded it will load quickly for subsequent requests for the page. I suspect that the application is loading the resources for page into memory. Is there a way to 'pre-load' all of the pages of the application before use? And to keep them loaded? It seems that after some time the slow load will return, possibly because of garbage collection.
I've tried a bunch of the strategies advised by other comments and questions. The Web App is set to be 'Always-On' and it is compiled into a single DLL.
Any help would be appreciated. Thanks.

Enable Application Insights and use profiling to identify the bottleneck. https://learn.microsoft.com/en-us/azure/application-insights/app-insights-profiler

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

Rails 4: metainspector gem slowing app down

In my Rails 4 app, I am using the metainspector gem to allow users to display meta data from a URL they post to a form.
Since I installed this gem, each time I try to visit the page of my own app where metadata is pulled from another website, load time increases significantly.
The load time increase goes from an imperceptible delay for small and local websites, to almost freezing the app for larger and foreign websites.
To give you an idea, a regular page usually loads under 400 ms: when we pull data with metainspector, it can go beyond a 30,000 ms (I measured these load times with rack-mini-profiler).
I did not find much about similar issues online.
Here is what I am trying to figure out:
Does this sound normal or did I setup something in the wrong way?
Is there a way to speed up load time with metainspector? For instance by caching responses?
If there is no way to speed up load time, should I implement a timeout limit and display an error message?
That is perfectly normal, to be exact it's not metainspector what is slowing your app down, it's the fact that you're requesting external URLs.
You should try to cache the responses using the built-in caching mechanism in metainspector, but also if possible move this to an asynchronous job using a background queue, and save or cache the result.

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.

IIS 7 over time performance degrading when rendering partial views

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.

Should I care about the DOM processing time in Newrelic Rails app?

I am using Newrelic on my Ruby on Rails app? In the "Browser page load time" section, I can see a large portion of the loading time falls into the "DOM processing"(about 5 sec). I just want to know if this is normal? Should I be worrying about this and optimizing this more? There a lots of JS code in my app and many DOM are dynamically created, I think that is why its taking the most time to load. But the Firebug shows the load time is 6.18s (onload: 5.16s), seems to be pretty fast loading to me, and many js load a at the bottom of the page.
Thanks
If you want to improve client load times, then yes, you should care :) If not, don't worry about it.
https://newrelic.com/docs/features/how-does-real-user-monitoring-work

Resources