Reputation: 6895
I have a few codeigniter controllers executed through command line. They are big and complex scripts.
I've been experiencing high cpu loads on my server and tracked down the cause to those scripts.
Is there a way to know what part of the scripts is eating up the cpu?
The scripts are running on a ubuntu and php 5.3
Upvotes: 1
Views: 3800
Reputation: 56
You could use some like xhprof to profile your php scripts. Profiling with xhprof
Upvotes: 3
Reputation: 7895
Use the built-in profiler
http://codeigniter.com/user_guide/general/profiling.html
$this->output->enable_profiler(TRUE);
edit:
sorry, just saw someone mentioned this in the comments... Leaving for posterity.
Upvotes: 1