Why is it sometimes very slow when I visit the same project? Yii is used.

Source: Internet
Author: User
Why is it sometimes very slow when you visit the same project? Yii is used.
When visiting 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/ anotheraction , and then re-access the action This 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.
------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.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.