For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2006 > slow loading page









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author slow loading page
redhat

2006-02-13, 6:56 pm

I have just installed Centos 4.2 running on a new Dell server (Xeon
2.4Ghz, SCSI HD, 1GB RAM) with apache 2.0.52, PHP 4.3.9 and MySQL
4.1.12. There is NOTHING in the html directory yet except for a simple
index.php page with two echo statements in it for demo purposes. The
statement is as follows:
<?php
echo ("<h2>Hello World</h2>");
echo ("font color=\"red\" face=\"helvetica\" size=\"20px\">This is
www.domain.com</font>");
?>

This page takes about 20 seconds to load. When I do the same page but
with plain html it loads in a fraction of a second. The server is about
20 feet away from me in a server room too. I didn't compile the PHP or
Apache from source either - it is from the disro install. Anyone else
have any issues like this? I should have virtually zero latency on this
set up. I also turned on (php.ini) error display and I get no errors
displayed nor any in the log files - it just takes forever to load.
When I do a <?php phpcredits(); ?> it also takes about the same amount
of time to load.
thanks,
Doug
JeRRy

2006-02-14, 6:56 pm

Hi,

Do this...

1) ping your local server. (paste us the results)
2) ping your IP address FOR THE SERVER (paste us the results)
3) If your server has a domain attached also ping this (paste us the results)

Pointless? No... If you ping your local server with the localhost ip or command everything should return virtually instantley. If not, hello? Your more likely got a hardware issue. But if it's returned instantley we can just about rule out a hardware
problem. But could be a settings issue.

Ping your IP address, not localhost. Now if this is slow your net connection maybe to blame, even your web host maybe denying you full access and halting loadings times. What is your net up/down speeds?

ping the domain, make sure the domain is reading to the server promply. Using a browser is not always a good area to test loading time. As depending on other programs etc it could vary quite hugly. Ping over 50 times than average the amounts out. So
me will be instant and some may take 3 seconds, average them out though to get a better idea of time frame.

Now as for PHP versus HTML, HTML will generally load faster than any PHP code but there should be only a small amount of time difference between the two, depending on code legnth and what actions are to be made.

I suggest you completely delete your PHP code, ..start again.

Something basic like ..

<? php // the all famous php start code
echo "Hello<br>Welcome to www.domain.com";
?>

Or something to that degree. Not thinking atm.

Or whip this in, for some infomration detail...

<? php
phpinfo();
?>

Feel free to post your temp. ip address or domain here or to me and I will be happy to test for you.

There is codes you can have that you put in some PHP and it details the time the page took to load.

You may need to include some variable handles in .htaccess also. Because on a default installation I think the default FIRST look file is .htm file rather than .php file. So maybe it's looping to find it? Damn it could be a million things, the more de
tail you list the better.

I suggest you run phpinfo() and show us the details that is outputted or create a page and give us a url. :) We can always test speed and get back to you. It might NOT be anything to worry about, it might sort itself out. :)

If your using the server for other things at the same time this may slow down things too.

J




Micah Stevens wrote: > > Not enough information there to make any sort of diagnosis, but here are > some things to try to narrow down the problem: > > 1) ssh into the server, and run 'top' to watch the process list. Then > while watching that,
hit reload in the browser to see if the HTTP process > pegs out while you're waiting for the page. If it does, for some reason > apache/php is struggling. Otherwise it's likely something else. > > 2) run 'ngrep' on port 80 of the incoming networ
k interface (eth0, or > whatever it's hooked to), and reload the page again. Are you immediatly > seeing the request come though or does it take a while? This type of thing > could be caused not by the webserver, but instead by a badly configured
> router, or something in the network. If it takes a while to come through, > you need to look at your network configuration. > > 3) Is this a DNS issue? If you're accessing via a domain name, and not a > direct IP type

URL, a shoddy DNS connection could make things really take > a long time. 3a) If so, is hostname lookup turned on for apache logging? This may result in yet another query to the DNS. I'm not sure however whether that lookup might delay delive
ry of the document, or whether the document is served independently og logging actions; I would guess the latter. Cheers -- David Robley "I'm never anywhere on time," Tom related.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com