网页,可以检查每个运行在它上面的SQL的速度

I have problem with my site in which one of the page is very slow. I using Wampsever 2.5,Apache 2.4.9, PHP 5.5.12,window 7. What I want to know is.

  1. Can we config anything for when web load?
  2. Can we get time speed for all query running on this web page/ or can tell this page speed time load on what (process on query/js/css/performent code)?

we can see on log, it's too slow

enter image description here

First you need to check with the console if your website is slow because of the assets. Google Pagespeed will give you recommendations to improve that.

Then if you want to check what's happen on your server side, you can trace your code with that excellent tool

https://blackfire.io

You will easily see how long last each PHP method.

For your MySQL you can enable slow queries http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html

I suspect you have a buffering issue. If you do not flush the buffer PHP will not send byte one until the script has completed.

This is how I almost always start a PHP page. I find the 'ob_gzhandler' is necessary otherwise the flush is ignored by the server's gzip handler.

<?php   ob_start("ob_gzhandler");
header('Content-Type: text/html; charset=utf-8');
header('Connection: Keep-Alive');
header('Cache-Control: max-age=2592030');
echo <<<EOT
<!DOCTYPE html><html lang="en">
<head>
<title>Template</title>
<style type="text/css">
<style>
</head>
<body>

As much of the HTML as you can put before any computational PHP goes before the first flush.

EOT;
ob_flush();

As soon as the ob_flush is executed the HTML before the flush is being transmitted to the Browser.

If the PHP code is generating a lot of HTML in a loop an ob_flush can be inserted in the loop after each chunk of HTML is generated.