SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: very slow sites

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    very slow sites

    Hi

    I have a server running PHP5 on IIS 6.0 (win 2003) - the sites has become very slow lately when shown by their external address (internet address) - taking up to several seconds before they show up on the browser, while loading VERY fast when I view them locally on the server. Is there anything in the PHP configuration that might cause this? Or should I keep on looking for network issues? tips would be appreciated.

    regards
    Pilu

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unlikely it's a php problem unless its something self provoked in the code. You could rule out php very quickly by saving the html output of a php script to a htm file, and then seeing if that loads much faster.

    That would leave you mostly with the network and the webserver. Try pinging and theres some dns speed test kinda tools on the web you can try. It could be a bandwidth bottleneck too, although you would probably blatantly notice the difference in speed around peak traffic time.

  3. #3
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi crmalibu

    Thanx for the tips.

    I tried to put the php output to a plain html and its VERY fast even through the Internet. Sounds like a PHP problem doesn't? or perhaps MySQL. Again this is not the case when browsing internal - ONLY external.

    Anyone idea?

  4. #4
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need some kind of measurement to figure out what's wrong. Try to start by putting a basic timer in to your php-script and print the result out at the bottom of the page. That'll tell you if it's the script that takes long, or if it happens beforehand. Eg. at the top of your page put this:

    PHP Code:
    $GLOBALS['time_start'] = microtime(true); 
    And at the bottom of your page, put this:
    PHP Code:
    print "<p>Page rendered in " number_format((microtime(true) - $GLOBALS['time_start']) * 10004) . " ms</p>"

  5. #5
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken View Post
    You need some kind of measurement to figure out what's wrong. Try to start by putting a basic timer in to your php-script and print the result out at the bottom of the page. That'll tell you if it's the script that takes long, or if it happens beforehand. Eg. at the top of your page put this:

    PHP Code:
    $GLOBALS['time_start'] = microtime(true); 
    And at the bottom of your page, put this:
    PHP Code:
    print "<p>Page rendered in " number_format((microtime(true) - $GLOBALS['time_start']) * 10004) . " ms</p>"
    Thanks for the tip - this is what I got:

    "Page rendered in 31.6060 ms"

    And the page showed up in the browser first after 4-5 seconds.

    It is very puzzling:

    1. PHP are rendered fast no matter where I browse from (internal or external)
    2. PHP pages show up on the browser slow when browsing externally fast when browsed internally
    3. Plain HTML show up on the browser fast when browsed externally


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •