On Mon, Jun 22, 2009 at 11:33 PM, PD wrote:
>
> Hello Everyone,
>
> I am developing a simple cake application which is causing CPU
> spikes. I dont know what I am doing wrong. I have pasted my controller
> code below.
>
> class DatasyncController extends AppController
> {
> (..)
>
Oh where to begin...
most of the points made so far have been very valid, you ideally
should optimizing your application by unbinding unused models etc,
only loading those you need, and since you have the overhead of using
the framework, again ideally, use your models(and the framework as a
whole
You have very messy code, more likely MySQL is dying there because a
lot of queries.
Look into cake SQL log.
Use recursive property of models or Containable behavior to optimize
models.
Use cache where you can.
Check table indexes.
Switch to innodb engine for all those updates.
Use "return false"
Well, that's not exactly the simplest code. What did you expect? And
why do you have so many raw SQL queries? You're using 5 models and not
even taking advantage of the framework.
Also, $phoneTypes should be a model class var. Defining it within a
controller method is a bit dodgy, I think.
On Mon
and so many exit() at the end of a function?
On Tue, Jun 23, 2009 at 5:48 PM, Walther wrote:
> First, what do you mean by CPU spikes? What action causes it, and have
> you run a profiler on it?
>
> Second, why are you using raw SQL queries?
>
> On Jun 23, 4:33 am, PD wrote:
> > Hello Everyone,
First, what do you mean by CPU spikes? What action causes it, and have
you run a profiler on it?
Second, why are you using raw SQL queries?
On Jun 23, 4:33 am, PD wrote:
> Hello Everyone,
>
> I am developing a simple cake application which is causing CPU
> spikes. I dont know what I am doing wr
Hello Everyone,
I am developing a simple cake application which is causing CPU
spikes. I dont know what I am doing wrong. I have pasted my controller
code below.
class DatasyncController extends AppController
{
public $uses = array('LiveServer', 'LivePhone', 'SyncLog', 'Server',
'Phone