Slow page loads, max execution time out

View: New views
20 Messages — Rating Filter:   Alert me  

Slow page loads, max execution time out

by amfriedman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 increasingly slow on 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 "max execution" 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 on slow load 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 each page: 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 profile page, 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 actual
execution of the beforeFilter() method for my first page render 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by James K :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The "restrict" behavior was brought into the core in RC1. It's now
called "contain".

Replace all your restrict calls with contain instead.

amfriedman 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 increasingly slow on 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 "max execution" 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 on slow load 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 each page: 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 profile page, 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 actual
> execution of the beforeFilter() method for my first page render 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by DaveMahon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


It's probably a stupid question, but have you clicked on the Context
link to find the function in your code that is leading to the errant
model queries?

On Jun 26, 11:48 am, amfriedman <AMFried...@...> 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 increasingly slow on 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 "max execution" 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 on slow load 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 each page: 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 profile page, 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 actual
> execution of the beforeFilter() method for my first page render 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by amfriedman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


UPDATE:

Thanks James K!

I did research Containable behavior and have replaced 'restrict' with
'contain'.  The model errors are gone now.

* 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 <AMFried...@...> 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 increasingly slow on 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 "max execution" 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 on slow load 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 each page: 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 profile page, 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 actual
> execution of the beforeFilter() method for my first page render 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by amfriedman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



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 <AMFried...@...> 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 increasingly slow on 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 on slow load 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 each page: 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 profile page, 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 first page render 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by amfriedman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 <AMFried...@...> 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 <AMFried...@...> 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by Alessio-12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have similar problems...I think it is good to submit this real
problem to the team...because this is not only your problem...

On 1 Lug, 00:27, amfriedman <AMFried...@...> wrote:

> 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 <AMFried...@...> 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 <AMFried...@...> 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 cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by Jonathan Snook-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You can submit it but I don't think they'll be much help. I feel like
this is environment specific.

Between lines 1 and 2 are mostly file includes and function/class
declarations. There's very little that would would take 9 secs to
load. However, these delays could be related to delayed file reads.
Are there any bad sectors on the drive? Are there any files referenced
on another network resource that maybe isn't available? (I'm grasping
at straws here but it's a weird issue. :)

On Tue, Jul 1, 2008 at 4:56 AM, Alessio <unideatore@...> wrote:
>
> I have similar problems...I think it is good to submit this real
> problem to the team...because this is not only your problem...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by dr. Hannibal Lecter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yeah, what about security on your machine? I haven't tried Vista yet
(but I've been told it's a PITA), could it be that Windoze is running
security checks every time apache/php tries to read a file?

On Jul 1, 1:51 pm, "Jonathan Snook" <jonathan.sn...@...> wrote:

> You can submit it but I don't think they'll be much help. I feel like
> this is environment specific.
>
> Between lines 1 and 2 are mostly file includes and function/class
> declarations. There's very little that would would take 9 secs to
> load. However, these delays could be related to delayed file reads.
> Are there any bad sectors on the drive? Are there any files referenced
> on another network resource that maybe isn't available? (I'm grasping
> at straws here but it's a weird issue. :)
>
> On Tue, Jul 1, 2008 at 4:56 AM, Alessio <unideat...@...> wrote:
>
> > I have similar problems...I think it is good to submit this real
> > problem to the team...because this is not only your problem...
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by amfriedman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks for the straws.  Better than nothing.

Remember, things were fine for the first few months of coding.  I
changed nothing in Vista.

Not sure if this is related: when I disable all models by setting
$uses = null; in every controller, then page load times go down to 1-2
seconds.  Is it possible to slow an app down by declaring too many
models in each controller?  Some of my controllers have as many as 10
models declared.

The thing is, as I incrementally included models in just ONE
controller, and my page load increases; with one model added, it goes
to 10 sec.  With two, it times out again!

?

On Jul 1, 9:56 am, "dr. Hannibal Lecter" <lecter...@...> wrote:

> Yeah, what about security on your machine? I haven't tried Vista yet
> (but I've been told it's a PITA), could it be that Windoze is running
> security checks every time apache/php tries to read a file?
>
> On Jul 1, 1:51 pm, "Jonathan Snook" <jonathan.sn...@...> wrote:
>
> > You can submit it but I don't think they'll be much help. I feel like
> > this is environment specific.
>
> > Between lines 1 and 2 are mostly file includes and function/class
> > declarations. There's very little that would would take 9 secs to
> >load. However, these delays could be related to delayed file reads.
> > Are there any bad sectors on the drive? Are there any files referenced
> > on another network resource that maybe isn't available? (I'm grasping
> > at straws here but it's a weird issue. :)
>
> > On Tue, Jul 1, 2008 at 4:56 AM, Alessio <unideat...@...> wrote:
>
> > > I have similar problems...I think it is good to submit this real
> > > problem to the team...because this is not only your problem...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by keymaster :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Don't use $uses, ever, it slaughters performance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by AD7six :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On Jul 1, 8:07 pm, amfriedman <AMFried...@...> wrote:

> Thanks for the straws.  Better than nothing.
>
> Remember, things were fine for the first few months of coding.  I
> changed nothing in Vista.
>
> Not sure if this is related: when I disable all models by setting
> $uses = null; in every controller, then page load times go down to 1-2
> seconds.  Is it possible to slow an app down by declaring too many
> models in each controller?  Some of my controllers have as many as 10
> models declared.
>
> The thing is, as I incrementally included models in just ONE
> controller, and my page load increases; with one model added, it goes
> to 10 sec.  With two, it times out again!

What did your investigation conclude as to why it takes 9s (in your
stack trace above) to even get to cake.

Have you by chance deleted the sub folders in your tmp folder? That
was|is a cause of awful performance.

AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by gurkzor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 2 Juli, 12:08, keymaster <ad...@...> wrote:
> Don't use $uses, ever, it slaughters performance.

So, what are we supposed to use instead?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@...
To unsubscribe from this group, send email to cake-php-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Slow page loads, max execution time out

by Sam Sherlock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So, what are we supposed to use instead?

app::import

2008/7/8 gurkzor <