I have a fresh "installation" of yii with a mysql database in the background.
If i want to get the db connection from the app:
$connection = Yii::app()->db;
it needs about 1 second to this.
Is there any trick to speed it up?
Debug to find the time used in Connecting to a database.
Test it using WebGrind .
I have tested it takes around 10ms for my case.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.