PHP Driven Site responding slow on different networks.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • j askey

    PHP Driven Site responding slow on different networks.

    I have a strange bandwidth issue that I have finally tracked down to
    something fairly specific if anyone has any ideas...

    Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI

    Network: DSL line with a Cisco 678 router using NAT and static port
    maps. Two switches between webserver and Cisco.

    Problem: Accessing PHP driven site via any computer except the web
    server is about 20 times slower. I can get fast response on the server
    by browsing to it's local IP address (http://10.0.0.x) or
    (http://localhost). However, if I use the external IP address
    (65.100.86.X) from the IIS server, the site is slow again. I figured
    that my Cisco had an issue or there was some problem in my network, so I
    replaced my Cisco with my spare and swapped out hubs for switches etc
    internally with no change. If I use a different computer on my LAN to go
    to http://10.0.0.X then I get the same slow response. I have packet
    dumped my network (nothing strange) and even disconnected all computers
    except for the IIS server and I still get the same results. I really
    thought it was a network issue until I replaced everything. If I telnet
    to one of the slow IP addresses, the HTML just comes out slower. I still
    think this is a network issue but I just wanted to post here in case
    there was something strange with PHP under 2k3 that I was missing.

    thanks for any suggestions anyone might have (unless they are to switch
    over to Apache. ;-)

    If anyone wants to try... http://www.gamearchive.com

    thanks... jess

  • Jochen Daum

    #2
    Re: PHP Driven Site responding slow on different networks.

    Hi J!

    On Mon, 26 Jan 2004 18:23:33 -0700, j askey <_jess_@askeydo t.org>
    wrote:
    [color=blue]
    >I have a strange bandwidth issue that I have finally tracked down to
    >something fairly specific if anyone has any ideas...
    >
    >Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
    >
    >Network: DSL line with a Cisco 678 router using NAT and static port
    >maps. Two switches between webserver and Cisco.
    >
    >Problem: Accessing PHP driven site via any computer except the web
    >server is about 20 times slower. I can get fast response on the server
    >by browsing to it's local IP address (http://10.0.0.x) or
    >(http://localhost). However, if I use the external IP address
    >(65.100.86.X ) from the IIS server, the site is slow again. I figured
    >that my Cisco had an issue or there was some problem in my network, so I
    >replaced my Cisco with my spare and swapped out hubs for switches etc
    >internally with no change. If I use a different computer on my LAN to go
    >to http://10.0.0.X then I get the same slow response. I have packet
    >dumped my network (nothing strange) and even disconnected all computers
    >except for the IIS server and I still get the same results. I really
    >thought it was a network issue until I replaced everything. If I telnet
    >to one of the slow IP addresses, the HTML just comes out slower. I still
    >think this is a network issue but I just wanted to post here in case
    >there was something strange with PHP under 2k3 that I was missing.[/color]

    Often these issues are DNS or Reverse DNS issues, eg. the machine not
    being able to look after one of these entries.

    How you sort that out with these magic-now-everything-better-Win2003
    machines - I don't know.

    HTH, Jochen
    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

    Comment

    • j askey

      #3
      Re: PHP Driven Site responding slow on different networks.

      I actually found this in a older other newsgroup posting... seems like I
      need to wait for SP1...

      ------

      This class of perf issues has been reported, we have investigated, and we
      will have a fix in the next Windows Server 2003 Service Pack. The class of
      perf issues is not limited to ASP -- can affect PHP, Perl, etc . It also
      manifests itself differently between local access and remote access.

      This is a simple illustration of the worst problem:

      <%
      Response.Buffer = true

      Response.Write ( "Start: " & Now & "<br>" )

      FOR i = 1 TO 100000
      Response.Write( "A" )
      Response.Flush( )
      NEXT

      Response.Write ( "<br>stop: " & Now & "<br>" )
      %>


      What we have found was that there are several interacting issues -- some are
      IIS perf issues, and some are user-code perf issues -- so even with our
      fixes, a user's website may be slower.

      Basically, if you want to improve performance, buffering has to happen in
      some form -- either you do it, or the system does a guess for you. The
      layers under IIS5 would buffer network traffic in some form regardless of
      "response.buffe r = false" -- but with IIS6, you can actually see the effects
      of no buffering...

      ----------

      end attachment

      Jochen Daum wrote:
      [color=blue]
      > Hi J!
      >
      > On Mon, 26 Jan 2004 18:23:33 -0700, j askey <_jess_@askeydo t.org>
      > wrote:
      >
      >[color=green]
      >>I have a strange bandwidth issue that I have finally tracked down to
      >>something fairly specific if anyone has any ideas...
      >>
      >>Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
      >>
      >>Network: DSL line with a Cisco 678 router using NAT and static port
      >>maps. Two switches between webserver and Cisco.
      >>
      >>Problem: Accessing PHP driven site via any computer except the web
      >>server is about 20 times slower. I can get fast response on the server
      >>by browsing to it's local IP address (http://10.0.0.x) or
      >>(http://localhost). However, if I use the external IP address
      >>(65.100.86. X) from the IIS server, the site is slow again. I figured
      >>that my Cisco had an issue or there was some problem in my network, so I
      >>replaced my Cisco with my spare and swapped out hubs for switches etc
      >>internally with no change. If I use a different computer on my LAN to go
      >>to http://10.0.0.X then I get the same slow response. I have packet
      >>dumped my network (nothing strange) and even disconnected all computers
      >>except for the IIS server and I still get the same results. I really
      >>thought it was a network issue until I replaced everything. If I telnet
      >>to one of the slow IP addresses, the HTML just comes out slower. I still
      >>think this is a network issue but I just wanted to post here in case
      >>there was something strange with PHP under 2k3 that I was missing.[/color]
      >
      >
      > Often these issues are DNS or Reverse DNS issues, eg. the machine not
      > being able to look after one of these entries.
      >
      > How you sort that out with these magic-now-everything-better-Win2003
      > machines - I don't know.
      >
      > HTH, Jochen[/color]

      Comment

      • Chung Leong

        #4
        Re: PHP Driven Site responding slow on different networks.

        Given that the page header manages to get sent before the delay occur, I
        would say there's something in the PHP code. The only thing that changes
        when you use a different IP to access the site is SERVER_ADDR. Perhaps
        you're passing that variable to the database open routine? If so, change
        that to localhost.

        Uzytkownik "j askey" <_jess_@askeydo t.org> napisal w wiadomosci
        news:d4jRb.72$b 22.0@fe07.usene tserver.com...[color=blue]
        > I have a strange bandwidth issue that I have finally tracked down to
        > something fairly specific if anyone has any ideas...
        >
        > Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
        >
        > Network: DSL line with a Cisco 678 router using NAT and static port
        > maps. Two switches between webserver and Cisco.
        >
        > Problem: Accessing PHP driven site via any computer except the web
        > server is about 20 times slower. I can get fast response on the server
        > by browsing to it's local IP address (http://10.0.0.x) or
        > (http://localhost). However, if I use the external IP address
        > (65.100.86.X) from the IIS server, the site is slow again. I figured
        > that my Cisco had an issue or there was some problem in my network, so I
        > replaced my Cisco with my spare and swapped out hubs for switches etc
        > internally with no change. If I use a different computer on my LAN to go
        > to http://10.0.0.X then I get the same slow response. I have packet
        > dumped my network (nothing strange) and even disconnected all computers
        > except for the IIS server and I still get the same results. I really
        > thought it was a network issue until I replaced everything. If I telnet
        > to one of the slow IP addresses, the HTML just comes out slower. I still
        > think this is a network issue but I just wanted to post here in case
        > there was something strange with PHP under 2k3 that I was missing.
        >
        > thanks for any suggestions anyone might have (unless they are to switch
        > over to Apache. ;-)
        >
        > If anyone wants to try... http://www.gamearchive.com
        >
        > thanks... jess
        >[/color]


        Comment

        • Dan Tripp

          #5
          Re: PHP Driven Site responding slow on different networks.

          j askey wrote:[color=blue]
          > I actually found this in a older other newsgroup posting... seems like I
          > need to wait for SP1...
          >
          > ------
          >
          > This class of perf issues has been reported, we have investigated, and we
          > will have a fix in the next Windows Server 2003 Service Pack. The class of
          > perf issues is not limited to ASP -- can affect PHP, Perl, etc . It also
          > manifests itself differently between local access and remote access.
          >
          > This is a simple illustration of the worst problem:
          >
          > <%
          > Response.Buffer = true
          >
          > Response.Write ( "Start: " & Now & "<br>" )
          >
          > FOR i = 1 TO 100000
          > Response.Write( "A" )
          > Response.Flush( )
          > NEXT
          >
          > Response.Write ( "<br>stop: " & Now & "<br>" )
          > %>
          >
          >
          > What we have found was that there are several interacting issues -- some
          > are
          > IIS perf issues, and some are user-code perf issues -- so even with our
          > fixes, a user's website may be slower.
          >
          > Basically, if you want to improve performance, buffering has to happen in
          > some form -- either you do it, or the system does a guess for you. The
          > layers under IIS5 would buffer network traffic in some form regardless of
          > "response.buffe r = false" -- but with IIS6, you can actually see the
          > effects
          > of no buffering...
          >
          > ----------
          >
          > end attachment
          >
          > Jochen Daum wrote:
          >[color=green]
          >> Hi J!
          >>
          >> On Mon, 26 Jan 2004 18:23:33 -0700, j askey <_jess_@askeydo t.org>
          >> wrote:
          >>
          >>[color=darkred]
          >>> I have a strange bandwidth issue that I have finally tracked down to
          >>> something fairly specific if anyone has any ideas...
          >>>
          >>> Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
          >>>
          >>> Network: DSL line with a Cisco 678 router using NAT and static port
          >>> maps. Two switches between webserver and Cisco.
          >>>
          >>> Problem: Accessing PHP driven site via any computer except the web
          >>> server is about 20 times slower. I can get fast response on the
          >>> server by browsing to it's local IP address (http://10.0.0.x) or
          >>> (http://localhost). However, if I use the external IP address
          >>> (65.100.86.X) from the IIS server, the site is slow again. I figured
          >>> that my Cisco had an issue or there was some problem in my network,
          >>> so I replaced my Cisco with my spare and swapped out hubs for
          >>> switches etc internally with no change. If I use a different computer
          >>> on my LAN to go to http://10.0.0.X then I get the same slow response.
          >>> I have packet dumped my network (nothing strange) and even
          >>> disconnected all computers except for the IIS server and I still get
          >>> the same results. I really thought it was a network issue until I
          >>> replaced everything. If I telnet to one of the slow IP addresses, the
          >>> HTML just comes out slower. I still think this is a network issue but
          >>> I just wanted to post here in case there was something strange with
          >>> PHP under 2k3 that I was missing.[/color]
          >>
          >>
          >>
          >> Often these issues are DNS or Reverse DNS issues, eg. the machine not
          >> being able to look after one of these entries.
          >>
          >> How you sort that out with these magic-now-everything-better-Win2003
          >> machines - I don't know.
          >>
          >> HTH, Jochen[/color]
          >
          >[/color]

          Sounds like you'd be able to spell relief: "A-P-A-C-H-E"

          ;)

          - Dan

          Comment

          • j askey

            #6
            Re: PHP Driven Site responding slow on different networks.

            heh heh... but I just came from A-P-A-C-H-E land. :-) I needed .net
            support without having to stuble around in cassini's sort of strict
            environment for now. But, you are right, if I don't get this working
            better soon. Im heading back over the hill.

            Dan Tripp wrote:
            [color=blue]
            > j askey wrote:
            >[color=green]
            >> I actually found this in a older other newsgroup posting... seems like
            >> I need to wait for SP1...
            >>
            >> ------
            >>
            >> This class of perf issues has been reported, we have investigated, and we
            >> will have a fix in the next Windows Server 2003 Service Pack. The
            >> class of
            >> perf issues is not limited to ASP -- can affect PHP, Perl, etc . It also
            >> manifests itself differently between local access and remote access.
            >>
            >> This is a simple illustration of the worst problem:
            >>
            >> <%
            >> Response.Buffer = true
            >>
            >> Response.Write ( "Start: " & Now & "<br>" )
            >>
            >> FOR i = 1 TO 100000
            >> Response.Write( "A" )
            >> Response.Flush( )
            >> NEXT
            >>
            >> Response.Write ( "<br>stop: " & Now & "<br>" )
            >> %>
            >>
            >>
            >> What we have found was that there are several interacting issues --
            >> some are
            >> IIS perf issues, and some are user-code perf issues -- so even with our
            >> fixes, a user's website may be slower.
            >>
            >> Basically, if you want to improve performance, buffering has to happen in
            >> some form -- either you do it, or the system does a guess for you. The
            >> layers under IIS5 would buffer network traffic in some form regardless of
            >> "response.buffe r = false" -- but with IIS6, you can actually see the
            >> effects
            >> of no buffering...
            >>
            >> ----------
            >>
            >> end attachment
            >>
            >> Jochen Daum wrote:
            >>[color=darkred]
            >>> Hi J!
            >>>
            >>> On Mon, 26 Jan 2004 18:23:33 -0700, j askey <_jess_@askeydo t.org>
            >>> wrote:
            >>>
            >>>
            >>>> I have a strange bandwidth issue that I have finally tracked down to
            >>>> something fairly specific if anyone has any ideas...
            >>>>
            >>>> Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
            >>>>
            >>>> Network: DSL line with a Cisco 678 router using NAT and static port
            >>>> maps. Two switches between webserver and Cisco.
            >>>>
            >>>> Problem: Accessing PHP driven site via any computer except the web
            >>>> server is about 20 times slower. I can get fast response on the
            >>>> server by browsing to it's local IP address (http://10.0.0.x) or
            >>>> (http://localhost). However, if I use the external IP address
            >>>> (65.100.86.X) from the IIS server, the site is slow again. I figured
            >>>> that my Cisco had an issue or there was some problem in my network,
            >>>> so I replaced my Cisco with my spare and swapped out hubs for
            >>>> switches etc internally with no change. If I use a different
            >>>> computer on my LAN to go to http://10.0.0.X then I get the same slow
            >>>> response. I have packet dumped my network (nothing strange) and even
            >>>> disconnected all computers except for the IIS server and I still
            >>>> get the same results. I really thought it was a network issue until
            >>>> I replaced everything. If I telnet to one of the slow IP addresses,
            >>>> the HTML just comes out slower. I still think this is a network
            >>>> issue but I just wanted to post here in case there was something
            >>>> strange with PHP under 2k3 that I was missing.
            >>>
            >>>
            >>>
            >>>
            >>> Often these issues are DNS or Reverse DNS issues, eg. the machine not
            >>> being able to look after one of these entries.
            >>>
            >>> How you sort that out with these magic-now-everything-better-Win2003
            >>> machines - I don't know.
            >>>
            >>> HTH, Jochen[/color]
            >>
            >>
            >>[/color]
            >
            > Sounds like you'd be able to spell relief: "A-P-A-C-H-E"
            >
            > ;)
            >
            > - Dan
            > http://www.dantripp.com/[/color]

            Comment

            • j askey

              #7
              Re: PHP Driven Site responding slow on different networks.

              Okay, I did have a reverse DNS resolution issue but that is fixed now
              and it still loads slowly. Thanks for getting my butt in gear to fix
              that tho. ;-)

              Jochen Daum wrote:
              [color=blue]
              > Hi J!
              >
              > On Mon, 26 Jan 2004 18:23:33 -0700, j askey <_jess_@askeydo t.org>
              > wrote:
              >
              >[color=green]
              >>I have a strange bandwidth issue that I have finally tracked down to
              >>something fairly specific if anyone has any ideas...
              >>
              >>Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
              >>
              >>Network: DSL line with a Cisco 678 router using NAT and static port
              >>maps. Two switches between webserver and Cisco.
              >>
              >>Problem: Accessing PHP driven site via any computer except the web
              >>server is about 20 times slower. I can get fast response on the server
              >>by browsing to it's local IP address (http://10.0.0.x) or
              >>(http://localhost). However, if I use the external IP address
              >>(65.100.86. X) from the IIS server, the site is slow again. I figured
              >>that my Cisco had an issue or there was some problem in my network, so I
              >>replaced my Cisco with my spare and swapped out hubs for switches etc
              >>internally with no change. If I use a different computer on my LAN to go
              >>to http://10.0.0.X then I get the same slow response. I have packet
              >>dumped my network (nothing strange) and even disconnected all computers
              >>except for the IIS server and I still get the same results. I really
              >>thought it was a network issue until I replaced everything. If I telnet
              >>to one of the slow IP addresses, the HTML just comes out slower. I still
              >>think this is a network issue but I just wanted to post here in case
              >>there was something strange with PHP under 2k3 that I was missing.[/color]
              >
              >
              > Often these issues are DNS or Reverse DNS issues, eg. the machine not
              > being able to look after one of these entries.
              >
              > How you sort that out with these magic-now-everything-better-Win2003
              > machines - I don't know.
              >
              > HTH, Jochen[/color]

              Comment

              • j askey

                #8
                Re: PHP Driven Site responding slow on different networks.

                Chung Leong wrote:
                [color=blue]
                > Given that the page header manages to get sent before the delay occur, I
                > would say there's something in the PHP code. The only thing that changes
                > when you use a different IP to access the site is SERVER_ADDR. Perhaps
                > you're passing that variable to the database open routine? If so, change
                > that to localhost.[/color]

                I removed all my PHP code that refers to SERVER_ADDR or REMOTE_ADDR but
                all still acts the same. It is strange as I can watch the packet log and
                the delay is just on the web server machine, by something like 250ms
                per packet or so. If you look at the text over telnet port 80, the text
                actually comes through fairly consistent, just slow. Because of the way
                I have my page designed with nested tables, the rendering is delayed
                until the table structure is finished so it seems to take a long time
                before the page actually draws completely.

                I got some feedback from the guys in the microsoft.iis ng and from doing
                a log of IIS threads using iisstart, they seem to think that it is not
                IIS nor PHP but a network issue. The only thing I have not replaced yet
                is the NIC, will do that tomorrow.

                thanks for your insights.
                [color=blue]
                >
                > Uzytkownik "j askey" <_jess_@askeydo t.org> napisal w wiadomosci
                > news:d4jRb.72$b 22.0@fe07.usene tserver.com...
                >[color=green]
                >>I have a strange bandwidth issue that I have finally tracked down to
                >>something fairly specific if anyone has any ideas...
                >>
                >>Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
                >>
                >>Network: DSL line with a Cisco 678 router using NAT and static port
                >>maps. Two switches between webserver and Cisco.
                >>
                >>Problem: Accessing PHP driven site via any computer except the web
                >>server is about 20 times slower. I can get fast response on the server
                >>by browsing to it's local IP address (http://10.0.0.x) or
                >>(http://localhost). However, if I use the external IP address
                >>(65.100.86. X) from the IIS server, the site is slow again. I figured
                >>that my Cisco had an issue or there was some problem in my network, so I
                >>replaced my Cisco with my spare and swapped out hubs for switches etc
                >>internally with no change. If I use a different computer on my LAN to go
                >>to http://10.0.0.X then I get the same slow response. I have packet
                >>dumped my network (nothing strange) and even disconnected all computers
                >>except for the IIS server and I still get the same results. I really
                >>thought it was a network issue until I replaced everything. If I telnet
                >>to one of the slow IP addresses, the HTML just comes out slower. I still
                >>think this is a network issue but I just wanted to post here in case
                >>there was something strange with PHP under 2k3 that I was missing.
                >>
                >>thanks for any suggestions anyone might have (unless they are to switch
                >>over to Apache. ;-)
                >>
                >>If anyone wants to try... http://www.gamearchive.com
                >>
                >>thanks... jess
                >>[/color]
                >
                >
                >[/color]

                Comment

                • j askey

                  #9
                  SOLVED: PHP Driven Site responding slow on different networks.

                  Okay, after some playing with the network I still had no speed
                  improvement. So I went back to the know problem with IIS that outputs
                  looped text extremely poorly. After looking at my php.ini file it seems
                  I had output_bufferin g = Off still. I set this to output_bufferin g =
                  1500 and the page loaded in .541 seconds over the previous 11.497
                  seconds. Huge improvement!!! It is funny tho since the note on
                  output_bufferin g states that using it may slow down output so use
                  carefully. Apparently IIS6.0 has some network output issues that will be
                  fixed in SP1 but this works now. Thank you everyone for your help.

                  I guess I needed to get into the MS mindset now that Im not using
                  apache... 'slow down the output to make the page load faster'. DOH...
                  it's so logical! ;-)


                  j askey wrote:
                  [color=blue]
                  > I have a strange bandwidth issue that I have finally tracked down to
                  > something fairly specific if anyone has any ideas...
                  >
                  > Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI
                  >
                  > Network: DSL line with a Cisco 678 router using NAT and static port
                  > maps. Two switches between webserver and Cisco.
                  >
                  > Problem: Accessing PHP driven site via any computer except the web
                  > server is about 20 times slower. I can get fast response on the server
                  > by browsing to it's local IP address (http://10.0.0.x) or
                  > (http://localhost). However, if I use the external IP address
                  > (65.100.86.X) from the IIS server, the site is slow again. I figured
                  > that my Cisco had an issue or there was some problem in my network, so I
                  > replaced my Cisco with my spare and swapped out hubs for switches etc
                  > internally with no change. If I use a different computer on my LAN to go
                  > to http://10.0.0.X then I get the same slow response. I have packet
                  > dumped my network (nothing strange) and even disconnected all computers
                  > except for the IIS server and I still get the same results. I really
                  > thought it was a network issue until I replaced everything. If I telnet
                  > to one of the slow IP addresses, the HTML just comes out slower. I still
                  > think this is a network issue but I just wanted to post here in case
                  > there was something strange with PHP under 2k3 that I was missing.
                  >
                  > thanks for any suggestions anyone might have (unless they are to switch
                  > over to Apache. ;-)
                  >
                  > If anyone wants to try... http://www.gamearchive.com
                  >
                  > thanks... jess
                  >[/color]

                  Comment

                  • r@ucis.net

                    #10
                    Re: PHP Driven Site responding slow on different networks.

                    I was just experiencing this exact same problem. I had set up a new
                    server for a friend of mine that had a PHP application that I wrote. I
                    set it up on server 2003, and everything was working great for the
                    first week. Then this past Saturday night, I put the server into
                    production. Sunday, everything worked great. (There are about 40
                    computers that use this web server within the network) Then this
                    morning, everything started going extremely slow. Worked perfectly on
                    the local machine, but anywhere else it was slow as hell. I went as far
                    as replacing the NIC. Then I found this topic. the buffering option in
                    PHP completely fixed my problem, except that I didn't use a number, I
                    just turned it on. restarted IIS, and the pages that were taking
                    anywhere from 5-10 seconds, were taking only a split second to load.
                    Everything seemed normal.

                    I was about to switch everything over to apache, but I'm glad I was
                    able to figure this out. Thanks for this topic!

                    Comment

                    Working...