Why is access to the same project sometimes fast or slow? The Yii Post was last edited from acc972 to 2013-08-0711: 28: 24. when accessing a project such as hostmodulecontrolleraction, javaScript, img, css, and so on can be loaded in 0.2 seconds, but the html of View files can be loaded in 0.2 seconds sometimes, why is access to the same project sometimes fast or slow? Yii is used.
This post was last edited by acc972 at 11:28:24
When accessing a project, such as http: // host/module/controller/action
Js, img, and css files can be loaded within 0.2 seconds, but the html of View files can be loaded within 0.2 seconds sometimes, sometimes it takes more than 2 seconds or even 30 seconds to complete loading. This happens when I access this address for the first time, or when I access another view under this controller, such as http: // host/module/controller/anotheraction and then re-access the action address. in this case, not only the action address, but also the anotheraction address may occur. Is this the reason for my code? I use CDbCriteria as a data provider.
Yii PHP
Share:
------ Solution --------------------
Change your mind
When you access a page with enough content, for example, if PHP does not perform any operation, will the front-end page be occasionally slowed down by only 123?
If not, it means that the code on your page has problems and key code is sent for analysis.
If this happens, it will be slow, so consider other ideas.
------ Solution --------------------
Database access is fast and slow, which is a normal phenomenon, especially in a standalone test environment.
The operating system suspends the idle service (or even moves it to the hard disk to release the memory occupied by it)
If mysql is moved to the hard disk when you initiate an access request, it will take a little longer to read from the hard disk and restore the site.
In a website officially operated, it will not be suspended because it is always accessed by someone. Therefore, the results will be satisfactory.