stone140 Posted October 16, 2006 Share Posted October 16, 2006 Hi - You all really helped me out last time but I have a question that hopefully someone can help me out with.Which is the most likely case for my problem.When going to my site it takes forever to load. Once you are able to finally get in you can roam around the site without too much of a problem but its still slow. When traffic is low you can get in but again, its slow. I wrote the php / mysql code myself (i'm no professional) and i subcribe to DreamHost and have their basic plan. It says i get 80 gigs of bandwidth a month. Is it possible that they limit the amount able to be transfered at once or just that my coding sucks. In my site I pull images from a server and pull items from my mysql database. (usually only 1 or 2 queries a page). Quote Link to comment Share on other sites More sharing options...
neoform Posted October 16, 2006 Share Posted October 16, 2006 unless you've got some heavy sql queries with large databases and joins, it's your host that's slow. Quote Link to comment Share on other sites More sharing options...
xsist10 Posted October 16, 2006 Share Posted October 16, 2006 Are the images on a remote server to the site? Not clear in your explaination.Slow-downs can be a number of things. The best way to test is to see who long your script takes to execute. Do this like so (stolen from [url=http://www.php.net/microtime]www.php.net/microtime[/url]):Put this at the beginning of your code:[code]<?php// If you have PHP 5$start = microtime(true);// elsefunction microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);}$start = microtime_float();?>[/code]Put this at the end of your code:[code]<?php// If you have PHP 5$time_taken = microtime(true) - $start;// else$time_taken = microtime_float() - $start;echo "Time to execute script: ". $time_taken;?>[/code]You'll probably find that the server is slow in delivering the page if the time it takes to execute the page is less than 0.2 seconds. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.