slow loading page

slow loading page

am 13.02.2006 23:11:14 von Doug Finch

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:
echo ("

Hello World

");
echo ("font color=\"red\" face=\"helvetica\" size=\"20px\">This is
www.domain.com");
?>

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 it also takes about the same amount
of time to load.
thanks,
Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page

am 13.02.2006 23:24:53 von Micah Stevens

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 network 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.

4) If it is an apache issue, turn on extended status, and watch that while you
reload the page, that can give you an idea of what's taking so long.

I'm sure others will have even better troubleshooting ideas, but that's a
start I guess.

-Micah

On Monday 13 February 2006 2:11 pm, redhat wrote:
> 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:
> > echo ("

Hello World

");
> echo ("font color=\"red\" face=\"helvetica\" size=\"20px\">This is
> www.domain.com");
> ?>
>
> 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 it also takes about the same amount
> of time to load.
> thanks,
> Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page

am 14.02.2006 08:36:31 von robleyd

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 network 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 delivery 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.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page

am 14.02.2006 17:07:35 von Doug Finch

On Tue, 2006-02-14 at 18:06 +1030, David Robley wrote:
> 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 network 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 delivery 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.
>
Ran TOP - the system is still at 99.5% idle while the page is loading.
I also ran ngrep (new tool to me - very cool) and the requests came
through very quickly - rules this one out too. The only one that I
don't really have a way to test is the DNS issue. The server is sitting
in our DMZ and our firewall rules say that our corporate network can
have total freedom to the lower security items (like the DMZ). As for
the DNS - the server is a single server with two virtual domains (name
based, not IP) and we have a DNS server pointing to it. Are there any
ways to test the DNS server configuration? Any tools that I can try? I
feel like this is probably going to be my smoking gun here.
Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page

am 14.02.2006 17:42:02 von jusa_98

--0-489161752-1139935322=:97778
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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. Some 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 ..

echo "Hello
Welcome to www.domain.com";
?>

Or something to that degree. Not thinking atm.

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

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 detail 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 network 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 delivery 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.

--0-489161752-1139935322=:97778--

Re: Re: slow loading page

am 14.02.2006 18:56:51 von Doug Finch

On Wed, 2006-02-15 at 03:42 +1100, JeRRy wrote:
> 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. Some 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 ..
>
> > echo "Hello
Welcome to www.domain.com";
> ?>
>
> Or something to that degree. Not thinking atm.
>
> Or whip this in, for some infomration detail...
>
> > 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 detail 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 network 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 delivery 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.


Post from ping times:
(localhost while ssh'd into the server and "ping localhost")
64 bytes from localhost (127.0.0.1): icmp_seq=0 ttl=64 time=0.030 ms
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.023 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.022 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.023 ms

(arping from my internal network to the server in the DMZ by IP address)
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 8.874ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.134ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.135ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.131ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.022ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.057ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.133ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.142ms

(arping from my internal network to the server in the DMZ by name)
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.404ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.141ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.155ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.137ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.150ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.139ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.137ms
Unicast reply from 10.XX.XX.XX [00:0A:F4:F9:C3:00] 1.147ms

(ping from outside network on windows pc in cli)
Reply from 65.5.48.10: bytes=32 time=14ms TTL=62
Reply from 65.5.48.10: bytes=32 time=9ms TTL=62
Reply from 65.5.48.10: bytes=32 time=11ms TTL=62
Reply from 65.5.48.10: bytes=32 time=7ms TTL=62

The domain is www.fpunet.com - the httpd.conf file lists the index.php
as the first index type and also it is defined that way in the virtual
server portion of the config. I have the phpinfo page set as the
default index right now. I noticed that "Virtual Directory Support" is
"disabled". Could this be the source of my problem?
Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page

am 15.02.2006 02:35:54 von Micah Stevens

On the server, you can use Dig - it's a pretty good DNS tool. On windows you
can use nslookup I think.

-Micah

On Tuesday 14 February 2006 8:07 am, redhat wrote:
> On Tue, 2006-02-14 at 18:06 +1030, David Robley wrote:
> > 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 network 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 delivery 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.
>
> Ran TOP - the system is still at 99.5% idle while the page is loading.
> I also ran ngrep (new tool to me - very cool) and the requests came
> through very quickly - rules this one out too. The only one that I
> don't really have a way to test is the DNS issue. The server is sitting
> in our DMZ and our firewall rules say that our corporate network can
> have total freedom to the lower security items (like the DMZ). As for
> the DNS - the server is a single server with two virtual domains (name
> based, not IP) and we have a DNS server pointing to it. Are there any
> ways to test the DNS server configuration? Any tools that I can try? I
> feel like this is probably going to be my smoking gun here.
> Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page (solved)

am 15.02.2006 14:24:24 von Doug Finch

On Tue, 2006-02-14 at 17:35 -0800, Micah Stevens wrote:
> On the server, you can use Dig - it's a pretty good DNS tool. On windows you
> can use nslookup I think.
>
> -Micah
>
> On Tuesday 14 February 2006 8:07 am, redhat wrote:
> > On Tue, 2006-02-14 at 18:06 +1030, David Robley wrote:
> > > 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 network 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 delivery 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.
> >
> > Ran TOP - the system is still at 99.5% idle while the page is loading.
> > I also ran ngrep (new tool to me - very cool) and the requests came
> > through very quickly - rules this one out too. The only one that I
> > don't really have a way to test is the DNS issue. The server is sitting
> > in our DMZ and our firewall rules say that our corporate network can
> > have total freedom to the lower security items (like the DMZ). As for
> > the DNS - the server is a single server with two virtual domains (name
> > based, not IP) and we have a DNS server pointing to it. Are there any
> > ways to test the DNS server configuration? Any tools that I can try? I
> > feel like this is probably going to be my smoking gun here.
> > Doug
>
Well, it looks like it might be a DNS issue or at least a routing issue
after all. I hit the phpinfo page on the server from home (completely
different ISP) and it loaded like I thought it should have - very fast -
even for phpinfo. I guess I have to start digging around elsewhere for
the answer to this riddle. Thanks for the nugget called "ngrep" - I
will keep that one handy.
Doug

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: slow loading page (solved)

am 15.02.2006 17:12:51 von Micah Stevens

On Wednesday 15 February 2006 5:24 am, redhat wrote:
> Well, it looks like it might be a DNS issue or at least a routing issue
> after all. I hit the phpinfo page on the server from home (completely
> different ISP) and it loaded like I thought it should have - very fast -
> even for phpinfo. I guess I have to start digging around elsewhere for
> the answer to this riddle. Thanks for the nugget called "ngrep" - I
> will keep that one handy.
> Doug

Interesting. Might be your client computer too. Although I assume other
websites load quickly on it?

ngrep is the bomb. Glad I could share.
-Micah

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php