programguru Posted July 17, 2009 Share Posted July 17, 2009 have a situation where I have a specific website I am working on. Select the category, sub-category, then product. The product page loads very slowly for some reason. Even if there are not images on the page its just dragging. No other sites on the same server are having this issue. My supsicions are: --MySQL connection speed --MySQL data loading There are multiple form fields being populated. Does anyone know of a script for the actual page which I can test the speed of the MySQL query when the page loads? Link to comment https://forums.phpfreaks.com/topic/166353-by-third-page-the-page-is-loading-very-slow-php-mysql-speed-measuring-script/ Share on other sites More sharing options...
Amtran Posted July 17, 2009 Share Posted July 17, 2009 You can do this: Put this at the beginning of your script: <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; ?> And this at the end: <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); echo '<p>Page generated in '.$total_time.' seconds.</p>'."\n"; ?> Link to comment https://forums.phpfreaks.com/topic/166353-by-third-page-the-page-is-loading-very-slow-php-mysql-speed-measuring-script/#findComment-877226 Share on other sites More sharing options...
ldougherty Posted July 17, 2009 Share Posted July 17, 2009 You could also just try and run the queries in a tool such as phpmyadmin to see how long the query itself takes to return. Another good site load test is tools.pingdom.com which will show you how long each aspect of your page takes to render. Link to comment https://forums.phpfreaks.com/topic/166353-by-third-page-the-page-is-loading-very-slow-php-mysql-speed-measuring-script/#findComment-877272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.