Why is access to the same project sometimes fast or slow? Yii is used.

Source: Internet
Author: User
Why is access to the same project sometimes fast or slow? Yii can load javascript, img, css, etc. within 0.2 seconds when accessing a project such as http: // host/module/controller/action, however, the html of a view file can be loaded within 0.2 seconds. it may take more than 2 seconds or even 30 seconds to complete loading. Why is access to the same project sometimes fast or slow? Yii is used.
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.
------ 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.

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.