[email protected]
[Top] [All Lists]

Re: My App is Getting too Slow

Subject: Re: My App is Getting too Slow
From: AD7six
Date: Tue, 6 Apr 2010 03:42:36 -0700 PDT

On Apr 6, 10:06 am, Ayman Bedair <ayma...@xxxxxxxxx> wrote:
> My CakePHP app is getting very slow... Although the debug give me
> "(default) 79 queries took 24 ms"

79 queries is a lot. Even if each of those queries took 0ms (and
returned nothing) it'll cost you approximately 2ms per query - which
is not insignificant. Of course, if 78 of those queries are describes,
and there's only 1 'real' query you don't need to worry about them.

> the pages takes about 8 to 10
> seconds to load. Other script running on the same server are
> performing well, even empty pages on this same application is still
> loading good with all the App Controller functions running. Yet it is
> too slow in querying pages even if the autoRender is set to false. so
> it has nothing to do with the HTML and Images !! :(
> I thought it's with the mobile device detection I had there but that
> runs in the App Controller beforeFilter() function so it should be
> running on empty pages too !!!
> Is there a way i can debug that parts that makes all this delay ?!

Install debug kit ( http://github.com/cakephp/debug_kit ) and look at
the timer tab to get a broad idea of where most of your time goes

set debug to 0 to get more accurate timer info.


set debug to 0 and profile (http://xdebug.org/docs/profiler + e.g.
http://code.google.com/p/webgrind/) to see /exactly/ into which
functions your time is going.

Do not profile with debug > 0 as what you'll get will be inaccurate to
the point of pointless.

Use the results to know where to focus your efforts. Bear in mind that
if it's slow only because of some debug > 0 process you may not need
to do anything.



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 

To unsubscribe, reply using "remove me" as the subject.

<Prev in Thread] Current Thread [Next in Thread>