Jump to content

Slow initial page load with PHP/mySQL


lbillett

Recommended Posts

I've got a problem very similar to that discussed in this older thread. Basically, if left alone for a few minutes, attempting a page load can take quite a few seconds (10-20) or sometimes time out! However, after one page is served, successive page loads are of nice speed.

 

It's an XP WAMP machine using Mediawiki. It's on our local Intranet and it doesn't seem to matter if I use hostnames or the IP address. The loading is quite light, so I have a hard time believing it's traffic related. The machine it's on runs the MySQL server and the webserver ONLY.

 

Oh, and get this, I can see almost the same kind of behavior when PINGING the machine! Take a look.

C:\Documents and Settings\lbillett>ping 10.183.12.5

Pinging 10.183.12.5 with 32 bytes of data:

Request timed out.
Reply from 10.183.12.5: bytes=32 time<1ms TTL=128
Reply from 10.183.12.5: bytes=32 time<1ms TTL=128
Reply from 10.183.12.5: bytes=32 time<1ms TTL=128

Ping statistics for 10.183.12.5:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

On a local network! This makes me think it's not PHP related at all. Any ideas on how to trouble shoot this?

 

Thanks!!

Link to comment
Share on other sites

Sounds like a DNS issue.. Perhaps your web server is trying to do a lookup on your IP address and since it's internal, it can't find anything and causing the 10 - 20 second delay.

 

I would check that you have your internal DNS setup and pointing to the correct places, or edit your hosts file and see if you can map hostnames to your local IP, or disable hostname lookups in either your Apache config or PHP config if necessary.

Link to comment
Share on other sites

  • 2 weeks later...

PHPFreaks is right. Another way to fix this is to set your nameservers, the first one to that server and then the other one to the router / modem. In this way your computer will look at the server first and then go onto the internet. At this moment it's searching for that IP address at the internet, and then going local. I think you've got multiple routers or so?

Link to comment
Share on other sites

Perhaps it's because XP is not a server platform? 

 

Your ping test clearly shows that the machine itself has to wake up out of some sort of network slumber.  Is it possible that you have not disabled all the power management settings and some or all of the machine is going to sleep?  That might explain why it seems to have to wake up, but once it does it's ok.

 

In all seriousness though, if this is in anyway important to the company, you ought to have it running on a real server operating system -- either a windows server, linux or bsd etc.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.