Should I care about the DOM processing time in Newrelic Rails app? - ruby-on-rails

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

Related

Experiencing slow first time loads with Web Apps on Azure

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

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.

Rails Profiling Weirdness - Inconsistent Render Times Reported

This is a long shot, but I was wondering if anyone has any idea:
I'm profiling my Rails app with the NewRelic RPM in development, and I'm seeing some really long view load times. The thing is, the next time I load the page, it's an entirely different set of views that's taking a long time to load.
Page Load #1
Page Load #2
I'm not doing anything too crazy. Rails 4, Ruby 2, partial caching with memcached (but I'm seeing the same errors even when caching is disabled.)
Any idea what's up with this? It's not just an error with the logs, as the application is indeed taking a while to render this page. Not an error specific to NewRelic's RPM either -- I see the same thing with rails_panel.
It turns out this is an issue with the Garbage Collector. (I knew there had to be a reasonable explanation for this.)
There's a great post going on about this issue on the Discource Meta Forum. The tl;dr is to set your RUBY_GC_MALLOC_LIMIT to a higher value, to avoid garbage collections during renders.

MODX Revo: How can make pages load fast?

I'm working on a site with modx revo. I'm really annoyed by the slow loading op pages. There's a 2sec wait for a page load om my localhost ánd I have a SSD. I've been looking around to find out how to make pageload faster.
I do have alot of getResources-/Gallery (9 total) calls and two Wayfinder calls. I've read it had to to with those, so I got rid of all the getResources and changed them to customs snippets that do only what I need them to do, build a 3-4 item menu. It's still slow, only few hunderd ms slower.
The Galleries (5) are only 3-4 images. I also use babel that checks every resource id for it's translation counterpart.
I'm wondering if it has anything to do with my wampserver (v 2.2) settings...
Now that I've summed it all up, I does look like a heavy page. Will I get long pageloads with any CMS this way?
Any help/hint/tips are apreciated!
You might want to "cache" all snippet tags without using the exclamation mark [[! ... ]].
Here is a blog about caching guidelines: http://www.markhamstra.com/modx-blog/2011/10/caching-guidelines-for-modx-revolution/
Here is a current discussion about speed performance: http://forums.modx.com/thread?thread=74902#dis-post-415390

Resources