Why is it sometimes very slow when you visit the same project? Yii is used.
This post was last edited by acc972 on 2013-08-07 11:28:24
On a project such as http://host/module/controller/ Action
, JS, IMG, CSS, etc. can be loaded within 0.2 seconds, but the view file HTML can sometimes be loaded in 0.2 seconds, sometimes it takes more than 2 seconds or even 30 seconds to load complete. This happens when I first visit this address, or I access another view under the controller, such as http://host/module/controller/ anotheractionAnd then re-visit ActionThis address, and this situation is not only present in the action address, it is possible to occur on anotheraction. Excuse me, is this the reason for my code? I use Cdbcriteria as a data provider. Yii PHP
Share to:
------Solution--------------------
Then change the idea.
You have access to a page with enough content, such as PHP, without any calculations. The front page is only a 123 and occasionally super slow?
If not, that's you. The page code has a problem with the key code to analyze
If it's going to be slow, then consider other ideas.
------Solution--------------------
It is normal to have a fast and slow access to the database, especially in a stand-alone test environment
The operating system suspends the idle service (or even moves it to the hard disk, freeing up its occupied memory)
If you launch a visit, it happens that MySQL is moved to the hard drive, and there's a job that reads from the hard drive and resumes the scene, and of course it takes a little more time.
On a website that's officially running, it's always going to be suspended because someone is always accessible. So the effect will be satisfactory.