I've been doing some heavy debugging using xdebug and cachegrinder.
I found a list of calls in the core that take a tremendous amount of
time to load. It seems like the core is slow to get off the ground.
Take a look at the trace. Notice where there are HUGE leaps in
seconds (lines 1-2 and 19-20)
I am clueless as to what is going on here! I've done clearing out of
most of my model associations (and clearing the cache), but still, the
app times out.
I'm also surprised that no one has taken an interest yet!
( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in C:
\Users\Staples2\Documents\Tensegrity\cake_core\cake\libs\file.php on
line 379
Call Stack
# Time Memory Function Location
1 0.0145 89952 {main}( ) ..\index.php:0
2 9.1401 4758232 Dispatcher->dispatch( ) ..\index.php:115
3 9.6720 5131024 Controller->constructClasses( ) ..\dispatcher.php:215
4 10.1213 6035896 Controller->loadModel( ) ..\controller.php:402
5 10.1247 6037640 ClassRegistry->init( ) ..\controller.php:446
6 10.9692 7603112 Model->__construct( ) ..\class_registry.php:128
7 11.7518 8731464 Model->__createLinks( ) ..\model.php:357
8 12.2008 8940896 Model->__constructLinkedModel( ) ..\model.php:565
9 12.2012 8941360 ClassRegistry->init( ) ..\model.php:592
10 12.2234 8985080 Model->__construct( ) ..\class_registry.php:128
11 12.5602 9038264 Model->__createLinks( ) ..\model.php:357
12 13.2462 9114600 Model->__constructLinkedModel( ) ..\model.php:565
13 13.2466 9115064 ClassRegistry->init( ) ..\model.php:592
14 13.2687 9158280 Model->__construct( ) ..\class_registry.php:128
15 13.5726 9195944 Model->__createLinks( ) ..\model.php:357
16 14.6799 9344248 Model->__constructLinkedModel( ) ..\model.php:565
17 14.6802 9344712 ClassRegistry->init( ) ..\model.php:592
18 14.7019 9381816 Model->__construct( ) ..\class_registry.php:128
19 14.9958 9401984 Model->__createLinks( ) ..\model.php:357
20 29.6973 10620160 Model->__constructLinkedModel( )
..\model.php:565
21 29.6977 10620632 ClassRegistry->init( ) ..\model.php:592
22 29.7643 10654608 Model->__construct( )
..\class_registry.php:128
23 29.7783 10665216 Model->setSource( ) ..\model.php:356
24 29.7956 10666472 Model->schema( ) ..\model.php:708
25 29.7990 10667192 DboMysql->describe( ) ..\model.php:826
26 29.7990 10668736 DataSource->describe( ) ..\dbo_mysql.php:185
27 29.7991 10669344 DataSource->__cacheDescription( ) ..
\datasource.php:241
28 29.9595 10672248 Cache->write( ) ..\datasource.php:403
29 29.9892 10673360 FileEngine->write( ) ..\cache.php:224
30 29.9960 10674464 File->write( ) ..\file.php:153
31 29.9960 10674928 File->open( ) ..\file.php:231
32 29.9962 10675296 File->exists( ) ..\file.php:140
On Jun 30, 11:11 am, amfriedman <[EMAIL PROTECTED]> wrote:
> James K - I did research Containable behavior and have replaced
> 'restrict' with
> 'contain'. The model errors are gone now. Thanks for that one.
>
> ** However, the performance problem continues. **
>
> I was also thinking about app_controller. I let my laziness get the
> best of me and loaded it up with 12 helpers, which are used by
> different controllers around the site. I also have 5 components
> initialized in app_controller. Perhaps I'm getting the performance
> hit here. What do folks think?
>
> On Jun 26, 11:48 am, amfriedman <[EMAIL PROTECTED]> wrote:
>
> > Hi all
>
> > I'm developing a social networking app. Performance-wise, the app is
> > working decently well on the live server, but as I've coded and coded
> > over the past few months, it has become increasinglyslowon my local
> > development PC. I'm running WAMP on Windows Vista.
>
> > My only hunch right now is that there are too many DB queries. But to
> > bring the app to its knees? It still doesn't seem like enough to me.
>
> > I've disabled CSS, I've disabled JS, still no change in performance.
> > It has to be server-side, since I'm getting "maxexecution" timeouts
> > regularly now -- even with debug set to 0.
>
> > My coding practices:
>
> > - I have tried to meticulously follow Cake's coding conventions.
> > - I've read through GoogleGroups onslowload and, yes, made sure my /
> > tmp/ folder has the necessary sub-folders intact.
> > - I almost always use 'restrict' in my find() calls to severely limit
> > the number of tables a query will need, especially when I'm recursing
> > to 3 levels.
>
> > Here's the specs:
>
> > 10 controllers
> > 25 models
> > 40 view files (incl elements)
> > 10 custom helpers
> > 12 custom components
> > 2 vendors, of 2K LOC
> > 5 includes, in /files/ in webroot, of 5K LOC
> > Avg. total image data on eachpage: 170K size
> > Avg number of models in $uses array in each controller: 6.
>
> > One odd thing I noticed was that, once I upgraded to Cake v1.2.0.7125
> > (RC1), in debug mode, my pages are now littered with 20-30 of these,
> > echoing out from god-knows-where in the core:
>
> > Query: __resetAssociations
>
> > And, always, several of these as well:
>
> > Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> > check the manual that corresponds to your MySQL server version for the
> > right syntax to use near '__resetAssociations' at line 1 [C:\Users
> > \Staples2\Documents\Tensegrity\cake_core\cake\libs\model\datasources
> > \dbo_source.php, line 501]
>
> > So this __resetAssociations is a bad query being sent to the database.
>
> > In debug mode of 2 on a user profilepage, I run 116 queries that
> > total 634ms. The biggest hits on the MySQL side come from the
> > DESCRIBE queries on my tables, each of which take between 17 and
> > 47ms. All of my actual SELECT queries only take between 1 and 3ms on
> > average. Then those __resetAssociations queries which eat up 1 to 9ms
> > each.
>
> > I planted timestamps around my own files and the core files to find
> > bottlenecks, and here's what I found out:
>
> > In cake/core/bootstrap.php it takes 8-10 seconds to complete this
> > line: App::import('Dispatcher') .
>
> > There is also a 15-20 second period in running time between the
> > inclusion of the app_controller.php class file and the actualexecutionof
> > the beforeFilter() method for my firstpagerender in
> > app_controller.
>
> > I know these initial benchmarks are probably pretty superficial. I
> > just don't know enough about the core to try to guess where I should
> > be looking for bottlenecks.
>
> > Anything I'm missing??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---