PHP framework-thinkphp slow help to see what the reason? Posted code

Source: Internet
Author: User
Tags php framework
2.9978s (load:0.0130s init:0.0047s exec:2.9360s template:0.0441s)
Throughput Rate: 0.33req/s
Solutions

What do you mean, exec?


  
   
  
  
   
              
  
  
    • Bookmark Management
    • Bookmark categories
{/*span1 end*/}
    • Class= "Active" > All Categories
    • class= ' active ' > {$p. bookmarkcategory_name}
{/*span1 end*/} new Bookmark {$sc. bookmarkcategory_name} full Open {$vo. Bookmark_name}
{/*span10 end*/} {/*sui-row-fluid end*/}

Reply content:

2.9978s (load:0.0130s init:0.0047s exec:2.9360s template:0.0441s)
Throughput Rate: 0.33req/s
Solutions

What do you mean, exec?


  
   
  
  
   
              
  
  
    • Bookmark Management
    • Bookmark categories
{/*span1 end*/}
    • Class= "Active" > All Categories
    • class= ' active ' > {$p. bookmarkcategory_name}
{/*span1 end*/} new Bookmark {$sc. bookmarkcategory_name} full Open {$vo. Bookmark_name}
{/*span10 end*/} {/*sui-row-fluid end*/}

Exec is the program execution time, Load:0.0130s Init:0.0047s Exec:2.9360s Template:0.0441s
You're initializing here for 0.0047 seconds. 2.936 seconds of template rendering took 0.0441 seconds
Then you post the code of the template and can't play anything about it.

This JS write too poke. And actually loops the binding event.

exec:2.9360s is consumed here for the longest time.

PHP code execution is inefficient, or when interacting with the database, Chaku slow, or PHP code problems

TP itself is certainly not a problem, can appear for the following reasons:

    1. Please change the database configuration file localhost 127.0.0.1 , tp not only this problem, a lot of programs have this problem, I guess it may be related to the local computer configuration, but changed to 127.0.0.1 be no problem.

    2. The reason for the project itself.

If each page is executed for a long time, it basically belongs to problem 1. If a single page execution is slow, then a single page is checked.
My guess is that problem 1 is the most likely.

Turn on the server log and troubleshoot

should be your internal PHP logic code generated problems! It's been a long time.

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