Profiling an application with Yii
If all of the best practices for deploying a Yii application are applied and you still do not have the performance you want, then most probably there are some bottlenecks with the application itself. The main principle while dealing with these bottlenecks is that you should never assume anything and always test and profile the code before trying to optimize it.
In this recipe, we will try to find bottlenecks in the Yii blog demo application.
Getting ready
Download the latest Yii 1.1.x version from the following URL:
Unpack
demos/blogin yourwebrootandframeworkdirectories one level above it:framework www … index.php …In
index.php, correct the path toyii.php. It should be as follows:$yii=dirname(__FILE__).'/../framework/yii.php';
In
protected/yiic.php, correct the path toyiic.php. It should be:$yiic=dirname(__FILE__).'/../../framework/yiic.php';
Change
protected/config/console.phpto the following:return array...