![]() |
|
Customer Support
Why does your service seem slow?
Slow response time could be caused from several sources. You will need to perform some tests to see where it is coming from before reporting slowness:- There could be congestion on the internet between you and us that slows down your connection to us. To determine whether this is the problem, perform a traceroute test as described in this other FAQ to figure out if you are just experiencing bad internet connectivity, and not a problem with any of our servers.
- If you determine from traceroutes that there is no network congestion or internet routing problem interfering with your connection to us, then check the following:
- If your FTP file transfers are slow, check all the advice found here.
- If you think your MySQL queries are slow, you should make sure that all JOINS are done correctly (that left joins are not done backwards with tables in the wrong order), that every column mentioned in the WHERE or ORDER BY clause of any SELECT query has a table index on that column, and that you have no VARCHAR type columns in any table. You can make table indexes on columns and change column types using the Onsite Control Panel. If your tables and queries are not optimized this way, then your queries will be hundreds of times slower than they would otherwise be.
- If you think any page on your website is slow, remove any references in your HTML code to objects (like images, banners, etc) that are hosted elsewhere. If that other host is slow or having a problem and your page tells a browser to load something from that other site, then that other site will cause your page to render very slowly or not at all.
- If you think your PHP driven website is slow, use the PHP stopwatch below to time the page's execution. Create a new file in the same directory as the slow webpage named timer.php and copy/paste the following into it:
<?
After you do that and save the timer.php file, edit the file of the webpage that you think is slow, and insert the following PHP code:
class BC_Timer{
var $stime;
var $etime;
function get_microtime(){
$tmp=split(" ",microtime());
$rt=$tmp[0]+$tmp[1];
return $rt;
}
function start_time(){
$this->stime = $this->get_microtime();
}
function end_time(){
$this->etime = $this->get_microtime();
}
function elapsed_time(){
return ($this->etime - $this->stime);
}
}
?>
<? # start at the top of the file
Save the changes and reload that webpage. Even very complicated PHP pages should execute in less than a second.
# with a PHP open tag
require("timer.php");
$timer = new BC_Timer;
$timer->start_time();
# All your pre-existing PHP code goes here
# then at the end of the file, insert:
$timer->end_time();
echo number_format($timer->elapsed_time(), 3) . " seconds";
?>
If your script is taking longer, move the $timer->end_time(); line closer to the beginning of the script (after the call to start timer), save changes, and reload/refresh the page, check the time it took to execute. Keep moving the call to stop timer lower and lower and rechecking until you get a dramatic jump in elapsed time. That will show you where you need to improve your php coding. If your time dramatically slows down after a MySQL query, see #2 above on how to speed up queries.
User-Contributed Notes |
|||
|
|||
|
|||
|
|||
|
|
|||
Related Questions:
Can I have a crontab?
How do I do a traceroute to diagnose network problems?
My POST to a secure form results in a blank page, the same form, or a 500 Internal Server Error.
Internet Explorer shows a blank page on an SSL website like the Control Panel or signup page.
How do I get a command prompt on my own computer?
After I install Bugzilla, I get error 403 Forbidden.
How do I install Gallery?
Where can I find links to 'Standards-Compliant' Web browsers?
I am having trouble installing phpBB2
Do you provide CVS?
How do I use a robots.txt file?
Can I use streaming media on my site?
I installed Norton Internet Security, and now I can't see video and other multimedia.
Do you support Flash, Shockwave, Java Applets?
How do I use MnogoSearch Indexer?
Do you run Linux?
Can I use a blog or other content management system?
Do you have Postgres?
Why doesn't mivascript interpret GET variables?
How do I contact my registrar?
What does everything in a Wusage report mean?
Whenever I make changes with Movable Type I get SBOX errors.
Are there any resources for dealing with comment spam in a Movable Type blog?
How Do I Add A Google Sitemap To My Website?
Do you provide SVN?
What can I do to improve Drupal's loading speed?
Browse Categories:Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales |

