Hi Thiago,

I'll be thinking out loud here, I know you may or may not agree with
me as you're probably more experienced, but I'll still write them down
so you can hopefully get some ideas.

1) Caching - Have you tried turning the cache on? Or maybe one caching
engine doesn't work well with your infrastructure and you might want
to change to another engine?

2) Table indexes - You mentioned that before you have a 2 ~ 3,5
response time from the app, it might be possible that you forgot to
add or change indexes in your tables? Data grows exponentially and
your indexes might no longer be relevent. A fast query from the early
days of your database may not be as fast when you have a lot of rows
inserted.

3) Column types and joins - The database server takes an additional
toll casting column types of foreign keys included in a join. Try to
check if your key columns are uniform.

4) Pulling as much data as practical - While CakePHP's caching is
superb, it can only cache views out-of-the-box. If you want to cache
your queries, pull from the database as much as practical for your
application and store it using the caching engine. If that's not
possible at the moment, set this data to the view before the view is
cached. Doing this, you will be able to do manipulations on your data
set in the view, even after the cache is generated. Remember, *only*
pull out as much data as practically possible.

5) Use Containable, if much is too much - More often than not, using
CakePHP's associations and how it pulls records out of a find() will
also get you the associated data with the primary model you're working
on. This may cause a lot unused data being sent over the network,
congesting it and may make your application sluggish. If you're not
using the models associated with your primary model, make sure to mark
them with the Containable behavior and flag the 'contain' key in your
find() and $this->paginate arrays accordingly.

HTH,
OJ

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 
http://groups.google.com/group/cake-php?hl=en

Reply via email to