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? 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.

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.