Forum Moderators: coopster

Message Too Old, No Replies

PHP Script takes 20 seconds to load

         

craigcj

10:54 pm on Mar 19, 2005 (gmt 0)



Hi,

My friend's site is online on my server
If you visit there, you will see it takes 20 seconds (nearly exact) to load the home page, and 20 seconds for every other page you want to view.

My other friends site (on the same server) also uses php, but his works fine:

It would be great if someone could tell me what i need to change in my php settings.

Thanks,

Craig :)

[edited by: coopster at 11:13 pm (utc) on Mar. 19, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

jatar_k

10:26 pm on Mar 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld craigcj,

The thing is that is not likely the parser or server that are causing this.

The first thing I usually look at is the code itself. There are a ton of things that could cause this. I try to benchmark specific pieces of the code, add and remove things and generally play around until I can figure out what, specifically, is causing the slowdown.

It could even be another problem like too many remote images or scripts taking the time to load. It could be the images are too big.

As I said a slow page is only a starting point, there are amny, many things that could be causing it.

caspita

10:46 pm on Mar 21, 2005 (gmt 0)

10+ Year Member



is you friend using a database? I had same problem once but was able to find very easy that the problem was a long/huge query in a database joinig about 6 tables :-) ... amazing what a couple of indexes can do ;-), once I put the indexes, my query went down from >20 to < 1 sec!.

is you friend using reversal DNS look up? may be he is trying to look for the domain names for the IPs? that will also kill you if your server is not able to solve domains based in IPs and he is trying to... it was not my case but I do it also, in my case I just log the IP address and the run a cron job to do the reversal look up in an scheduled basis... but it would depend of what you are using that info for.

And as the previous porter said ;-) ther could be tons of reasons.. check the code, my two scenarios above are just from my own experince ;-).

Regardssssssss

beezee

10:59 pm on Mar 21, 2005 (gmt 0)

10+ Year Member



How big of a role does a particular host play in the delay, I wonder?