fw init

Hi,

am i wrong saying that when coldbox initiliazes it browse dirs to find all cfc’s?
Is there a way to exclude dirs when initializing?

Thanks

No, Coldbox does not do that. There are a few things you might be thinking of though.

  • ColdFusion ORM, if enabled, will scan your CFCLocation’s for ORM entities. If no CFCLocation is set, it will scan your web root. This is unrelated to Coldbox though.

  • WireBox has an option where you can use a mapDirectory( ‘myCoolModels’ ); call in your /config/WireBox.cfc (also called the binder config) and tell WireBox to map all the CFCs in a directory. This is optional and up to you to put in that configuration.

  • WireBox will register any handlers you have in your /handlers directory when it starts.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

ok thanks
it’s just that sometimes i received a timeout from the binder.cfc (from wirebox then i guess) on the cfdirectory
so i thought it was browsing every directories
what is a reasonnable time for initializing the framework?
sometimes it takes more than 30 seconds here
is it normal you think?

Please provide a stack trace of the error. Without that I can’t begin to guess what scenario you are dealing with.

App reinit times vary widely and are based on complexities as unique as your applications. if you’re curious what is taking so long, use a tool like Fusion Reactor to pull some stack traces during the reinit to see what it’s spending its time on.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

here is the stack trace
i will install fusion reactor right away
The request has exceeded the allowable time limit Tag: cfdirectory

The error occurred in //192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc: line 472
Called from //192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc: line 405
Called from //192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc: line 44
Called from //192.168.159.1/internet/site/coldbox/system/web/services/LoaderService.cfc: line 81
Called from //192.168.159.1/internet/site/coldbox/system/Coldbox.cfc: line 71
Called from //192.168.159.1/internet/site/Application.cfc: line 40
470 :
471 : <!— List Handlers —>
472 :
473 :
474 :
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Remote Address 192.168.253.1
Referrer
Date/Time 06-Jan-15 01:07 AM
Stack Trace
at cfHandlerService2ecfc1959285024$funcGETHANDLERLISTING.runFunction(//192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc:472) at cfHandlerService2ecfc1959285024$funcREGISTERHANDLERS.runFunction(//192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc:405) at cfHandlerService2ecfc1959285024$funcONCONFIGURATIONLOAD.runFunction(//192.168.159.1/internet/site/coldbox/system/web/services/HandlerService.cfc:44) at cfLoaderService2ecfc1871459633$funcLOADAPPLICATION.runFunction(//192.168.159.1/internet/site/coldbox/system/web/services/LoaderService.cfc:81) at cfColdbox2ecfc1452552281$funcLOADCOLDBOX.runFunction(//192.168.159.1/internet/site/coldbox/system/Coldbox.cfc:71) at cfApplication2ecfc2108982882$funcONAPPLICATIONSTART.runFunction(//192.168.159.1/internet/site/Application.cfc:40)

coldfusion.runtime.RequestTimedOutException: The request has exceeded the allowable time limit Tag: cfdirectory
at coldfusion.tagext.io.DirectoryTag.checkTimeout(DirectoryTag.java:382)
at coldfusion.tagext.io.DirectoryTag.doStartTag(DirectoryTag.java:276)
at cfHandlerService2ecfc1959285024$funcGETHANDLERLISTING.runFunction(\192.168.159.1\internet\site\coldbox\system\web\services\HandlerService.cfc:472)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
at cfHandlerService2ecfc1959285024$funcREGISTERHANDLERS.runFunction(\192.168.159.1\internet\site\coldbox\system\web\services\HandlerService.cfc:405)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659)
at cfHandlerService2ecfc1959285024$funcONCONFIGURATIONLOAD.runFunction(\192.168.159.1\internet\site\coldbox\system\web\services\HandlerService.cfc:44)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
at cfLoaderService2ecfc1871459633$funcLOADAPPLICATION.runFunction(\192.168.159.1\internet\site\coldbox\system\web\services\LoaderService.cfc:81)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
at cfColdbox2ecfc1452552281$funcLOADCOLDBOX.runFunction(\192.168.159.1\internet\site\coldbox\system\Coldbox.cfc:71)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432)
at cfApplication2ecfc2108982882$funcONAPPLICATIONSTART.runFunction(\192.168.159.1\internet\site\Application.cfc:40)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
at coldfusion.runtime.AppEventInvoker.onApplicationStart(AppEventInvoker.java:231)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:309)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.aurigma.imageuploaderflash.UploadFilter.doFilter(UploadFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

That code is ColdBox registering your handlers. How many handlers do you have? I can’t imagine performance issues there unless you somehow had thousands of handlers, which seems rather unlikely. That error doesn’t tell us that the cfdirectory took ALL the time though, it’s just what the code happened to be doing at the time that it timed out.

What is your request timeout set to? If it’s a rather small value, you may just need to increase it.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

we have 30seconds as timeout
and indeed not that much handlers
15-20 in handlers folders
plus a few in some modules

I recommend increasing the timeout for now. You can use Fusion Reactor to help determine what the requests are doing. There could be some slow queries or caching going on.

Also, what version of ColdBox and ColdFusion are you using?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

our infra team recommended that timeout (that’s what we used before moving to CB) but when in production they had to put it to something like 120seconds which seems huge to me
running on ACF10 with coldbox 3.8 if i remember well
what do you recommend i investigate exactly with fusion reactor?
it’s installed but dont’ really know where to start :slight_smile:

Open the “requests” > “Activity” page in FR and set the refresh from “none” to “1 Second”.
Hit your page and it will appear in the list after a second.
Click the little stack trace icon on that row (looks like little horizontal lines)
Keep refreshing the trace with the refresh button and looking at the stack to see what it is executing.

If necessary, do this several times and copy/paste the stacks into another file for reference. Remember, the stack is just a random point in time and may be meaningless, but USUALLY the slowest parts of your page have a statistically higher chance of running at the moment you pull the trace. That should at least get you started.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

ok i tried several times but it’s not that easy to use as it doesn’t keep history of the whole thing
and doesn’t easily let you see the time spent for each part

in fact those two lines in the application.cfc already take more than 20seconds to process

application.cbBootstrap = CreateObject(“component”,“coldbox.system.Coldbox”).init(COLDBOX_CONFIG_FILE,COLDBOX_APP_ROOT_PATH,COLDBOX_APP_KEY,COLDBOX_APP_MAPPING);
application.cbBootstrap.loadColdbox();
so, half the time it takes in total

> it’s not that easy to use as it doesn’t keep history of the whole thing

The history of the request is kept on the “Requests” > “History” tab. There’s quite a bit of information there: total time, number and JDBC requests, including the slowest SQL with it’s own times, incoming variables, headers, cookies, etc. Of course, it doesn’t store any stack traces-- that would be virtually impossible since there are probably hundreds of thousands of lines of Java code that run during a single request. How would it capture that data?

> doesn’t easily let you see the time spent for each part

What parts? Think about it-- out of the 10s of thousands of methods that are run on the JVM, how would it know which ones are meaningful to you?

I would recommend you look at ProfileBox. It’s a commercial Ortus product that installs as ColdBox module and feeds extra information to FusionReactor about the timing of your view, handler, interceptor, etc executions.
http://www.ortussolutions.com/products/profilebox

Also, on the topic of debugging tools, make sure you have turned off the “report execution times” setting for ColdFusion’s debug output. That stuff will really slow down a server.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Since those two lines are what creates the framework and loads it, yes, I would expect them to take most of the time. Again, make sure your “report execution times” are turned off.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Thanks i will investigate the profilebox thing as well
And for sure, report execution times is turned off

I might be way off base but I had some issues like this and stumbled on a gem of a post in the cf-orm-dev Google Group:

https://groups.google.com/d/msg/cf-orm-dev/0uRJLuh-Q7M/3cdLiv3QGasJ

The solution for my problem was to add useDBForMapping = false to my ORM Settings in Application.cfc

this.ormSettings = { cfclocation = "model", dbcreate = "none", dialect = "MicrosoftSQLServer", schema = "myschema", logSQL = true, flushAtRequestEnd = false, eventHandling = true, eventHandler = "model.ORMEventHandler", secondaryCacheEnabled = false, useDBForMapping = false };

My ReInit times were super fast after that. Make sure you do want that turned off in your case though:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html#WS2CED8D4C-8F3B-4f88-AEAA-D3F94F04964D