Hi Thiago,

I would try to replicate the entire system (lampp + your app +
database) in other server and check whether the "slowness" is due to
the server or not. You may also replicate a legacy PHP app, as you
call it, to check if it works well too. This replicated server will
allow you to test other experiments without jeopardizing your real
production data.

If the performance in the replicated server is equivalent to your
original one, check if its something in the cakephp lib. Create a
controller that doesn't use any models at all. If it's also slow, than
the problem is something about your cake, or its configuration. If
it's not, then it's probably your database.

Then you can start thinking about database optimization. Is all
queries slow? Try a simple "SELECT 1 FROM DUAL" in the legacy PHP and
in cakePHP. how many milisseconds each one takes (test both on the
browser)? Is AppController->beforeFilter doing something that may be
slowing down your queries?

Turn debug to 2 and for each query that it reports, check how much
time is it taking (it's right beside the query name). Try to run the
same query on the database directly and check if the timing is
compatible.

When my apps turn slow, I always think of the DB. Sometimes, it's just
a matter of creating the right indexes - for instance, if you run
"SELECT marafo_id, count(*) from naosei group by marafo_id", it'll be
really slow when you have lots (>100K) of rows and the grouped column
is not indexed. A simple "CREATE INDEX index_naosei_marafo_id ON
naosei (marafo_id);" would solve this problem.

Well, keep us all informed about these results. I'm very interested
because every once in a while I (and may I add, everybody =]) run into
this kind of problem too.

dfcp




On 11 ago, 22:29, Thiago Elias <[email protected]> wrote:
> Hi All,
>
> Since two or three months ago (more or less), I'm experiencing some problems
> involving CakePHP.
>
> In the past, our application was using a local database connection, and
> performance was really nice and acceptable. Some months ago, we had to
> migrate the application to another server, separating the Data and the Apps.
>
> After this change, I've lost performance in my cake App. Each request takes
> around 10 ~ 15 seconds, and before, was 2 ~ 3,5 secs.
> The interesting thing is: The other legacy PHP Apps are 100% fast, and even
> other cakeAPPs are fast too, but the difference is: My main cake app (the
> one that lost performance) have 80 innoDB Tables and 20 views. (used to link
> to another databases).
>
> I'm using CakePHP 1.2.7, PHP 5.2. And in the Database Server, MySQL Server
> 5.1.
> Our network infrastructure is really fast, and ping response between servers
> is really nice.
>
> Does anyone knows why I'm losing performance just in this App when connected
> to a remote server ?! I'm using CakePHP Debug, and ~85% of the time spent in
> the request is lost in the CORE, and not in the app. (The core is the same
> of the other cakeApps..)
>
> Please help-me (and sorry for my bad english).
>
> Thiago Elias

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