load speed

Discussion in 'PHP' started by xxsAm, May 29, 2007.

  1. #1
    xxsAm, May 29, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Both took about the same time for me.
     
    nico_swd, May 30, 2007 IP
  3. Xexi

    Xexi Well-Known Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    100
    #3
    Try adding a timer to your page. If the load times display about the same, then it is your web host.
     
    Xexi, May 30, 2007 IP
  4. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #4
    gibex, May 30, 2007 IP
  5. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #5
    There seems to be a delay in rendering for the second one suggesting server side issues. Have you tried comparing the execution times for the PHP code? A quick glance at the HTML hints that there is nothing wrong with the output.
     
    krt, May 30, 2007 IP
  6. xxsAm

    xxsAm Active Member

    Messages:
    464
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Would it have anything to do with the version of PHP my server is running? It is running Version 4.4.7 , should I upgrade it to the newest version?
     
    xxsAm, May 30, 2007 IP
  7. xxsAm

    xxsAm Active Member

    Messages:
    464
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #7
    xxsAm, May 30, 2007 IP
  8. xxsAm

    xxsAm Active Member

    Messages:
    464
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #8
    heres the one that seemed to load faster. the load speed is in the footer.
    http://www.layoutsmart.com/baseball.php

    so is what i need to do is cut down on the includes? or is there another fix?
     
    xxsAm, May 30, 2007 IP
  9. mrmonster

    mrmonster Active Member

    Messages:
    374
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #9
    It seems like the load speed is all over the place, sometimes its slow sometimes it fast. Also, it's not that any particular item on the page is holding things up, but it's as if the delay is in the initial request to the server.

    I did a few refreshes and on one of them an error showed up on line 3 of /contacttables/alcoholanddrugs/page01/index.php

    Warning: main() [function.main]: php_network_getaddresses: getaddrinfo failed: Name or service not known

    If you are using some kind of a DNS related name resolving, it might be the part thats slowing down the page sometimes when it can't resolve the address quickly.
     
    mrmonster, May 30, 2007 IP
  10. xxsAm

    xxsAm Active Member

    Messages:
    464
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #10
    Hmmm I see, not sure about the DNS problem. Would it have to do with me running PHproxy on the server slowing down php execution times?
     
    xxsAm, May 31, 2007 IP
  11. offthedome

    offthedome Active Member

    Messages:
    446
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    95
    #11
    They do load faster the second time they're loaded.
     
    offthedome, May 31, 2007 IP
  12. xxsAm

    xxsAm Active Member

    Messages:
    464
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #12
    problem fixed, got rid of all includes.
     
    xxsAm, May 31, 2007 IP
  13. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #13
    The miracle of browser caching ;)

    http://www.php.net/microtime Try one of those methods for determining how long PHP is actually processing. If the times are relatively low and standard across the board, then your DNS server or your apache are just taking some time to load up the relevant data and feed it to the user, so it'd be more of a bandwidth, server load or max connections issue than actual code.
     
    projectshifter, Jun 1, 2007 IP
  14. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Where you by any chance including your files by HTTP as opposed to the filesystem? That is to say, were your includes of the form:
    include( 'http://servername.com/somepagetoinclude.php' );

    as opposed to:
    include( 'somepagetoinclude.php' );

    ?
     
    TwistMyArm, Jun 1, 2007 IP
  15. offthedome

    offthedome Active Member

    Messages:
    446
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    95
    #15
    I wonder if it's something else, since the pages were all generated via php and includes. I'm still a php nube, but I thought php never got cached. I'm guessing the server saves the interpreted version of the page.
     
    offthedome, Jun 1, 2007 IP
  16. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #16
    PHP itself doesn't get cached by the server, but your browser at least caches stylesheets and the images, so pages will display faster because it's using images and styling already stored in it's memory.
     
    projectshifter, Jun 1, 2007 IP