[coldbox-3.5.2] Very Slow load times

116 views
Skip to first unread message

Mike

unread,
Apr 22, 2013, 10:27:58 AM4/22/13
to col...@googlegroups.com
Ok...so I have a simple app framework set up to do some proof of concept with a team of developers.  The most significant thing that will keep me from getting adoption is the speed...take a look at a common request.

10:05:48.558 AM     6 ms           invoking runEvent [Main.onRequestStart]
10:05:57.417 AM     7 ms           rendering View [Widgets/ParentSubNavigation.cfm]
10:05:57.422 AM     1573 ms        invoking runEvent [Dashboard:Widgets.ParentSubNavigation]
10:06:03.28  AM     7 ms         rendering View [Widgets/QuickStats.cfm]
10:06:03.33  AM     2799 ms     invoking runEvent [Dashboard:Widgets.QuickStats]
10:06:07.783 AM     9 ms         rendering View [Widgets/RelatedArticles.cfm]
10:06:07.788 AM     1945 ms     invoking runEvent [Dashboard:Widgets.RelatedArticles]
10:06:13.615 AM     8 ms         rendering View [Widgets/FeaturedPosts.cfm]
10:06:13.620 AM     2080 ms     invoking runEvent [Dashboard:Widgets.FeaturedPosts]
10:06:13.631 AM     22963 ms     invoking runEvent [Dashboard:home.index]
10:06:24.520 AM     15 ms         rendering View [home/index.cfm]
10:06:24.526 AM     9713 ms     rendering Layout [Layout.Main.cfm]

I used a technique of creating a "widget" handler only used for runevent commands so that I can easily build sub-navigation and well (left/right) content from within a module to the parent layout.  Works like a charm and the individual views that are collected only contain a few lines of HTML right now...but in this sample, the four that are called (dashboard:widgets) have HUGE rendering times as does the final layout.  I have employed some plugins in the modules, an AOP aspect to inhibit display for any method used in the "main" module controller ("home") and a view mapped singletons for some sample database interaction (very very minor).

Is runEvent inherently really really slow?  I've littered some log entries in the code but since no errors are being thrown, they are not much help.  Then, I started putting log entries in ondicomplete code where I can to ensure that code is not being repetitively run where not necessary...nothing yet, but still debugging.

Keep in mind, this site virtually does nothing where the user is concerned, but for CB I am using multiple modules (6 modules), plugins (1 core, 1 per module), AOP (1), about 3 service-type models and 3 transient models in two of the modules and a couple of each of the same in the "core" application.  So my bet is I'm overlooking something.

This is running locally on a fully patched CF 9.01 and Apache on a windows 7 computer with SQL Server as the DB.  While this is not my first rodeo, this is the biggest thing I've yet done with CB employing almost every "core-ish" feature (log, wire, aop, intercept, plugin, module)...again, to proof of concept to the team I work with.

So I guess what I'm asking is what "common" things have those of you with vastly more experience than I with CB encountered that would create such a slow-down...or what can I debug for that might help me find what might be creating the slow down?  Of course, this won't stop me from showing it today (yes, today) and just begging for them to excuse the speed issue I'm working on...my hope is that the other developers are much more interested in the guts of the site than it's speed, for now.

Thanks,

Mike



Jason Durham

unread,
Apr 22, 2013, 11:13:05 AM4/22/13
to col...@googlegroups.com
The common things that cause a CB application to be slow are the same things that would cause any ColdFusion application to be slow.  runEvent is not inherently slow.  I'm afraid we're left to shoot spit wads without seeing the code.



Jason Durham






--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

br...@bradwood.com

unread,
Apr 22, 2013, 11:36:18 AM4/22/13
to col...@googlegroups.com
A vanilla runEvent() should only take a few nano seconds.  Do you have any database access in your code?

Fire up SeeFusion or Fusion Reactor and pull some stracktraces during page load to see what the server is doing.  Also, make sure you have "report execution time" turned off in ColdFusion debugging. 

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 

Curt Gratz

unread,
Apr 22, 2013, 12:16:08 PM4/22/13
to <coldbox@googlegroups.com>
Also, keep in mind that runEvent fires the entire event lifecycle again, so you may want to use the prePostExempt flag on runEvent() if you don't need to run those again.

Curt Gratz
Computer Know How

On Apr 22, 2013, at 10:36 AM, <br...@bradwood.com>
 wrote:

Mike Craig

unread,
Apr 22, 2013, 12:19:06 PM4/22/13
to col...@googlegroups.com
Too much code, too many options, proprietary, db...I'd accept spit wads.  My hope was that someone else has said to themselves "wow, this is running slow, I wonder why" and provide insight as to what or where to look first.  Report execution time is off and I've disabled all debugging just to see with no difference.  prePostExempt is on for the runEvent commands.  I do use a database, MS SQL, two tables, 6 records a piece.  I roll my own services/DAO and transient objects for records and all of it is really really basic.  Can use FusionReactor...trial period over and cannot reinstall...try SeeFusion next I suppose.

Mike

MIKE CRAIG  |  SENIOR DEVELOPER
TERRA DOTTA, LLC  |  501 W FRANKLIN ST, STE 105, CHAPEL HILL, NC 27516  |  877.DOTTA.77


Mike Craig

unread,
Apr 22, 2013, 12:22:32 PM4/22/13
to col...@googlegroups.com
I'm betting I have something crazy in my dependencies (how they are being used, or something along those lines).  What continues to happen is after restarting CF, the site will run a little faster, but after around 10 requests (guessing on that number), the site eventually just spins away and gives me

The request has exceeded the allowable time limit Tag: CFLOOP             


a restart of CF or reboot of computer clears that right up :(  I find this ultimately happens much more quickly if I continue to reinit the framework since I have mapped singletons for my services and plugins.

Mike

MIKE CRAIG  |  SENIOR DEVELOPER
TERRA DOTTA, LLC  |  501 W FRANKLIN ST, STE 105, CHAPEL HILL, NC 27516  |  877.DOTTA.77




br...@bradwood.com

unread,
Apr 22, 2013, 12:31:56 PM4/22/13
to col...@googlegroups.com
A SeeFusion license is only $199 and you've probably spent that much in time troubleshooting already.  I wouldn't even begin to guess without opening the hood and looking.  Anything else is just wasted time IMO. 

Also, check memory usage.  The fact that your site runs ok for a few requests and then slows down is very interesting.  There's got to be something weird going on.  The stack trace will tell you exactly what the server is doing so you don't need to guess.

Also, for what it's worth you don't have to buy anything to get a stack trace, I just think it's way easier.  If you're on Enterprise, do a snapshot in the server admin.  If you're on standard, you should be able to start CF from the command line and send it a kill -9 command or something-- at least in Linux that is.  I've never actually done that myself, I've just used SeeFusion and moved on :)

Thanks!

~Brad

P.S.  If/when you use SeeFusion or Fusion-Reactor, enabled the JDBC URL Wrappers for your data sources.  Having the SQL info is invaluable.
Reply all
Reply to author
Forward
0 new messages