gethostbyaddr() bottleneck?

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

    gethostbyaddr() bottleneck?

    When there is no rDNS record on an IP address, then it might take a while for
    the reverse lookup to timeout. I'm thinking of how on a tracert you can
    observe the delay.

    If so, then calling gethostbyaddr() can delay the serving of the web page,
    right? Because gethostbyaddr() is not forked into a separate process. So I
    suppose I'd need to call gethostbyaddr() as the very last task for a script.
    Does that sound right? Or is there another way around the delay?
  • Jerry Stuckle

    #2
    Re: gethostbyaddr() bottleneck?

    RJ_32 wrote:
    When there is no rDNS record on an IP address, then it might take a while for
    the reverse lookup to timeout. I'm thinking of how on a tracert you can
    observe the delay.
    >
    If so, then calling gethostbyaddr() can delay the serving of the web page,
    right? Because gethostbyaddr() is not forked into a separate process. So I
    suppose I'd need to call gethostbyaddr() as the very last task for a script.
    Does that sound right? Or is there another way around the delay?
    >
    Why are you even trying to call gethostbyaddr() ? What do you need it
    for in your page?

    And even if it's the last thing on your page, it will still delay
    delivery of the page content.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • RJ_32

      #3
      Re: gethostbyaddr() bottleneck?

      Jerry Stuckle wrote:
      RJ_32 wrote:
      >When there is no rDNS record on an IP address, then it might take a
      >while for
      >the reverse lookup to timeout. I'm thinking of how on a tracert you can
      >observe the delay.
      >>
      >If so, then calling gethostbyaddr() can delay the serving of the web
      >page,
      >right? Because gethostbyaddr() is not forked into a separate process.
      >So I
      >suppose I'd need to call gethostbyaddr() as the very last task for a
      >script.
      >Does that sound right? Or is there another way around the delay?
      >>
      >
      Why are you even trying to call gethostbyaddr() ? What do you need it
      for in your page?
      just for a log to get an idea of where the visitors are coming from.

      I'd alternatively thought of maybe running a separate batch so to speak when I
      wanted to inspect the log.
      >
      And even if it's the last thing on your page, it will still delay
      delivery of the page content.
      Then would flush() solve that?

      Comment

      • Jerry Stuckle

        #4
        Re: gethostbyaddr() bottleneck?

        RJ_32 wrote:
        Jerry Stuckle wrote:
        >RJ_32 wrote:
        >>When there is no rDNS record on an IP address, then it might take a
        >>while for
        >>the reverse lookup to timeout. I'm thinking of how on a tracert you can
        >>observe the delay.
        >>>
        >>If so, then calling gethostbyaddr() can delay the serving of the web
        >>page,
        >>right? Because gethostbyaddr() is not forked into a separate process.
        >>So I
        >>suppose I'd need to call gethostbyaddr() as the very last task for a
        >>script.
        >>Does that sound right? Or is there another way around the delay?
        >>>
        >Why are you even trying to call gethostbyaddr() ? What do you need it
        >for in your page?
        >
        just for a log to get an idea of where the visitors are coming from.
        >
        I'd alternatively thought of maybe running a separate batch so to speak when I
        wanted to inspect the log.
        >
        >And even if it's the last thing on your page, it will still delay
        >delivery of the page content.
        >
        Then would flush() solve that?
        >
        >
        No, it won't. But then this is the wrong approach. That's what server
        logs are for.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • RJ_32

          #5
          Re: gethostbyaddr() bottleneck?

          Jerry Stuckle wrote:
          RJ_32 wrote:
          >Jerry Stuckle wrote:
          >>RJ_32 wrote:
          >>>When there is no rDNS record on an IP address, then it might take a
          >>>while for
          >>>the reverse lookup to timeout. I'm thinking of how on a tracert you can
          >>>observe the delay.
          >>>>
          >>>If so, then calling gethostbyaddr() can delay the serving of the web
          >>>page,
          >>>right? Because gethostbyaddr() is not forked into a separate process.
          >>>So I
          >>>suppose I'd need to call gethostbyaddr() as the very last task for a
          >>>script.
          >>>Does that sound right? Or is there another way around the delay?
          >>>>
          >>Why are you even trying to call gethostbyaddr() ? What do you need it
          >>for in your page?
          >>
          >just for a log to get an idea of where the visitors are coming from.
          >>
          >I'd alternatively thought of maybe running a separate batch so to
          >speak when I
          >wanted to inspect the log.
          >>
          >>And even if it's the last thing on your page, it will still delay
          >>delivery of the page content.
          >>
          >Then would flush() solve that?
          >>
          >>
          >
          No, it won't. But then this is the wrong approach. That's what server
          logs are for.
          >
          I'm expecting only 50 invited visitors or so. Making my own log is more
          convenient to get a quick look at who showed up, what UA they have etc.

          Why would flush() not work? What's the purpose of it then? It does work that
          way in Tomcat or Resin servlet containers, eg

          Comment

          • Jerry Stuckle

            #6
            Re: gethostbyaddr() bottleneck?

            RJ_32 wrote:
            Jerry Stuckle wrote:
            >RJ_32 wrote:
            >>Jerry Stuckle wrote:
            >>>RJ_32 wrote:
            >>>>When there is no rDNS record on an IP address, then it might take a
            >>>>while for
            >>>>the reverse lookup to timeout. I'm thinking of how on a tracert you can
            >>>>observe the delay.
            >>>>>
            >>>>If so, then calling gethostbyaddr() can delay the serving of the web
            >>>>page,
            >>>>right? Because gethostbyaddr() is not forked into a separate process.
            >>>>So I
            >>>>suppose I'd need to call gethostbyaddr() as the very last task for a
            >>>>script.
            >>>>Does that sound right? Or is there another way around the delay?
            >>>>>
            >>>Why are you even trying to call gethostbyaddr() ? What do you need it
            >>>for in your page?
            >>just for a log to get an idea of where the visitors are coming from.
            >>>
            >>I'd alternatively thought of maybe running a separate batch so to
            >>speak when I
            >>wanted to inspect the log.
            >>>
            >>>And even if it's the last thing on your page, it will still delay
            >>>delivery of the page content.
            >>Then would flush() solve that?
            >>>
            >>>
            >No, it won't. But then this is the wrong approach. That's what server
            >logs are for.
            >>
            >
            I'm expecting only 50 invited visitors or so. Making my own log is more
            convenient to get a quick look at who showed up, what UA they have etc.
            >
            Why would flush() not work? What's the purpose of it then? It does work that
            way in Tomcat or Resin servlet containers, eg
            >
            Flush will output current data in the PHP buffers. But you still have
            the web server's buffers, and, since the request is not complete, the
            browser may or may not show the information. This is not Tomcat or
            Resin. And BTW - those don't guarantee all of the output will be
            displayed by the browser immediately. Additionally, the browser will
            still wait for the request to be completed.

            Web servers already have logs to track all of that, and there are lots
            of tools around to give you the information you want.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Joe Butler

              #7
              Re: gethostbyaddr() bottleneck?

              so, you are saying the assumptions of code like the following are flawed?

              blah blah blah...

              print '</body></html>';

              ob_end_flush();

              // do this after the html so it does not delay
              // the page loading and can be used next time.
              // we are only seeing if it returns the name of a machine
              // on the network rather than the ip address, so that
              // for whitehall, it's easier to identify the machine that may
              // be locking the diary.
              if(!isset($_SES SION['strRemoteName'])){
              // only do this once, since it won't change during a session.
              $_SESSION['strRemoteName']= GetRemoteAddrNa me();
              }

              <end of file>

              "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              news:g9f5m0$d4s $1@registered.m otzarella.org.. .
              RJ_32 wrote:
              >Jerry Stuckle wrote:
              >>RJ_32 wrote:
              >>>Jerry Stuckle wrote:
              >>>>RJ_32 wrote:
              >>>>>When there is no rDNS record on an IP address, then it might take a
              >>>>>while for
              >>>>>the reverse lookup to timeout. I'm thinking of how on a tracert you
              >>>>>can
              >>>>>observe the delay.
              >>>>>>
              >>>>>If so, then calling gethostbyaddr() can delay the serving of the web
              >>>>>page,
              >>>>>right? Because gethostbyaddr() is not forked into a separate process.
              >>>>>So I
              >>>>>suppose I'd need to call gethostbyaddr() as the very last task for a
              >>>>>script.
              >>>>>Does that sound right? Or is there another way around the delay?
              >>>>>>
              >>>>Why are you even trying to call gethostbyaddr() ? What do you need it
              >>>>for in your page?
              >>>just for a log to get an idea of where the visitors are coming from.
              >>>>
              >>>I'd alternatively thought of maybe running a separate batch so to
              >>>speak when I
              >>>wanted to inspect the log.
              >>>>
              >>>>And even if it's the last thing on your page, it will still delay
              >>>>delivery of the page content.
              >>>Then would flush() solve that?
              >>>>
              >>>>
              >>No, it won't. But then this is the wrong approach. That's what server
              >>logs are for.
              >>>
              >>
              >I'm expecting only 50 invited visitors or so. Making my own log is more
              >convenient to get a quick look at who showed up, what UA they have etc.
              >>
              >Why would flush() not work? What's the purpose of it then? It does work
              >that
              >way in Tomcat or Resin servlet containers, eg
              >>
              >
              Flush will output current data in the PHP buffers. But you still have the
              web server's buffers, and, since the request is not complete, the browser
              may or may not show the information. This is not Tomcat or Resin. And
              BTW - those don't guarantee all of the output will be displayed by the
              browser immediately. Additionally, the browser will still wait for the
              request to be completed.
              >
              Web servers already have logs to track all of that, and there are lots of
              tools around to give you the information you want.
              >
              --
              =============== ===
              Remove the "x" from my email address
              Jerry Stuckle
              JDS Computer Training Corp.
              jstucklex@attgl obal.net
              =============== ===
              >

              Comment

              • Sjord

                #8
                Re: gethostbyaddr() bottleneck?

                On Sun, 31 Aug 2008 17:01:12 -0400, RJ_32 wrote:
                just for a log to get an idea of where the visitors are coming from.
                >
                I'd alternatively thought of maybe running a separate batch so to speak
                when I wanted to inspect the log.
                This would be better for performance. Log the IP addresses and then do
                gethostbyaddr() when you are inspecting the logs.

                Comment

                • Gordon

                  #9
                  Re: gethostbyaddr() bottleneck?

                  On Aug 31, 9:36 pm, RJ_32 <RJ...@none.com wrote:
                  When there is no rDNS record on an IP address, then it might take a while for
                  the reverse lookup to timeout. I'm thinking of how on a tracert you can
                  observe the delay.
                  >
                  If so, then calling gethostbyaddr() can delay the serving of the web page,
                  right? Because gethostbyaddr() is not forked into a separate process. So I
                  suppose I'd need to call gethostbyaddr() as the very last task for a script.
                  Does that sound right? Or is there another way around the delay?
                  If this isn't a vital part of a security system then you're probably
                  better off just examining $_SERVER ['REMOTE_ADDR'] to determine where
                  your visitors are coming from. It is a spoofable header, so you'll
                  need to sanitize it before attempting to insert into a database table,
                  bur from what it sounds like you want to do it ought to be adequate.

                  Comment

                  • Sjoerd

                    #10
                    Re: gethostbyaddr() bottleneck?

                    On Mon, 01 Sep 2008 03:13:05 -0700, Gordon wrote:
                    It is a spoofable header
                    Is $_SERVER['REMOTE_ADDR'] really spoofable? How? I thought it was simply
                    the IP of the client which connects to the HTTP server, thus determined
                    by the WWW server instead of being sent by the client.

                    Comment

                    • Jerry Stuckle

                      #11
                      Re: gethostbyaddr() bottleneck?

                      Joe Butler wrote:
                      "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                      news:g9f5m0$d4s $1@registered.m otzarella.org.. .
                      >RJ_32 wrote:
                      >>Jerry Stuckle wrote:
                      >>>RJ_32 wrote:
                      >>>>Jerry Stuckle wrote:
                      >>>>>RJ_32 wrote:
                      >>>>>>When there is no rDNS record on an IP address, then it might take a
                      >>>>>>while for
                      >>>>>>the reverse lookup to timeout. I'm thinking of how on a tracert you
                      >>>>>>can
                      >>>>>>observe the delay.
                      >>>>>>>
                      >>>>>>If so, then calling gethostbyaddr() can delay the serving of the web
                      >>>>>>page,
                      >>>>>>right? Because gethostbyaddr() is not forked into a separate process.
                      >>>>>>So I
                      >>>>>>suppose I'd need to call gethostbyaddr() as the very last task for a
                      >>>>>>script.
                      >>>>>>Does that sound right? Or is there another way around the delay?
                      >>>>>>>
                      >>>>>Why are you even trying to call gethostbyaddr() ? What do you need it
                      >>>>>for in your page?
                      >>>>just for a log to get an idea of where the visitors are coming from.
                      >>>>>
                      >>>>I'd alternatively thought of maybe running a separate batch so to
                      >>>>speak when I
                      >>>>wanted to inspect the log.
                      >>>>>
                      >>>>>And even if it's the last thing on your page, it will still delay
                      >>>>>delivery of the page content.
                      >>>>Then would flush() solve that?
                      >>>>>
                      >>>>>
                      >>>No, it won't. But then this is the wrong approach. That's what server
                      >>>logs are for.
                      >>>>
                      >>I'm expecting only 50 invited visitors or so. Making my own log is more
                      >>convenient to get a quick look at who showed up, what UA they have etc.
                      >>>
                      >>Why would flush() not work? What's the purpose of it then? It does work
                      >>that
                      >>way in Tomcat or Resin servlet containers, eg
                      >>>
                      >Flush will output current data in the PHP buffers. But you still have the
                      >web server's buffers, and, since the request is not complete, the browser
                      >may or may not show the information. This is not Tomcat or Resin. And
                      >BTW - those don't guarantee all of the output will be displayed by the
                      >browser immediately. Additionally, the browser will still wait for the
                      >request to be completed.
                      >>
                      >Web servers already have logs to track all of that, and there are lots of
                      >tools around to give you the information you want.
                      >>
                      so, you are saying the assumptions of code like the following are
                      flawed?
                      >
                      blah blah blah...
                      >
                      print '</body></html>';
                      >
                      ob_end_flush();
                      >
                      // do this after the html so it does not delay
                      // the page loading and can be used next time.
                      // we are only seeing if it returns the name of a machine
                      // on the network rather than the ip address, so that
                      // for whitehall, it's easier to identify the machine that may
                      // be locking the diary.
                      if(!isset($_SES SION['strRemoteName'])){
                      // only do this once, since it won't change during a session.
                      $_SESSION['strRemoteName']= GetRemoteAddrNa me();
                      }
                      >
                      <end of file>
                      >
                      That is correct. The assumptions are flawed.

                      And please don't top post.


                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • Jerry Stuckle

                        #12
                        Re: gethostbyaddr() bottleneck?

                        Sjoerd wrote:
                        On Mon, 01 Sep 2008 03:13:05 -0700, Gordon wrote:
                        >It is a spoofable header
                        >
                        Is $_SERVER['REMOTE_ADDR'] really spoofable? How? I thought it was simply
                        the IP of the client which connects to the HTTP server, thus determined
                        by the WWW server instead of being sent by the client.
                        >
                        Not spoofable per say - but it could be pointing at a proxy server.

                        --
                        =============== ===
                        Remove the "x" from my email address
                        Jerry Stuckle
                        JDS Computer Training Corp.
                        jstucklex@attgl obal.net
                        =============== ===

                        Comment

                        • Gordon

                          #13
                          Re: gethostbyaddr() bottleneck?

                          On Sep 1, 11:41 am, Sjoerd <sjoer...@gmail .comwrote:
                          On Mon, 01 Sep 2008 03:13:05 -0700, Gordon wrote:
                          It is a spoofable header
                          >
                          Is $_SERVER['REMOTE_ADDR'] really spoofable? How? I thought it was simply
                          the IP of the client which connects to the HTTP server, thus determined
                          by the WWW server instead of being sent by the client.
                          I think spoofable might be the wrong word. It can be misleading if the
                          user is connecting via a proxy though. I'm just in the habit of
                          treating everything that I didn't generate myself as untrustworthy.

                          Comment

                          • Joe Butler

                            #14
                            Re: gethostbyaddr() bottleneck?

                            I don't think the assumptions are flawed.

                            I just did a test:

                            print "blah blah..."

                            print "</body></html>";

                            sleep(5);

                            print "something else";

                            Now, when I monitor the network packets, my page completes as expected and
                            renders in a timely fashion. 5 seconds later, I get "something else" and
                            that is appended to the end of the rendered page and the network packets
                            comfirm that it is 5 seconds after the first packet for the page was
                            delivered. The browser did still show, "page loading" in the status bar,
                            though.

                            Without the sleep, it seems that "something else" can get stuck into the
                            same final page network packet. So, I'm guessing that, for efficiency, if
                            Apache has some buffered data due to be sent out, and more unbuffered output
                            is generated before that has been sent, that it will be appended to the data
                            that has not yet been passed on to the network transmission.

                            So, it seems that it is worthwhile doing a lookup after the final page
                            flush, as there is nothing to loose. Particularly if you are not outputing
                            more data to the user, but simply doing some extra work, such as logging
                            (for 50 users a day).

                            This was a linux Apache and the browser was Firefox 1.5.

                            "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            news:g9gobe$6b4 $3@registered.m otzarella.org.. .
                            Joe Butler wrote:
                            >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            >news:g9f5m0$d4 s$1@registered. motzarella.org. ..
                            >>RJ_32 wrote:
                            >>>Jerry Stuckle wrote:
                            >>>>RJ_32 wrote:
                            >>>>>Jerry Stuckle wrote:
                            >>>>>>RJ_32 wrote:
                            >>>>>>>When there is no rDNS record on an IP address, then it might take a
                            >>>>>>>while for
                            >>>>>>>the reverse lookup to timeout. I'm thinking of how on a tracert you
                            >>>>>>>can
                            >>>>>>>observ e the delay.
                            >>>>>>>>
                            >>>>>>>If so, then calling gethostbyaddr() can delay the serving of the
                            >>>>>>>web
                            >>>>>>>page,
                            >>>>>>>right? Because gethostbyaddr() is not forked into a separate
                            >>>>>>>proces s.
                            >>>>>>>So I
                            >>>>>>>suppos e I'd need to call gethostbyaddr() as the very last task for
                            >>>>>>>a
                            >>>>>>>script .
                            >>>>>>>Does that sound right? Or is there another way around the delay?
                            >>>>>>>>
                            >>>>>>Why are you even trying to call gethostbyaddr() ? What do you need
                            >>>>>>it
                            >>>>>>for in your page?
                            >>>>>just for a log to get an idea of where the visitors are coming from.
                            >>>>>>
                            >>>>>I'd alternatively thought of maybe running a separate batch so to
                            >>>>>speak when I
                            >>>>>wanted to inspect the log.
                            >>>>>>
                            >>>>>>And even if it's the last thing on your page, it will still delay
                            >>>>>>deliver y of the page content.
                            >>>>>Then would flush() solve that?
                            >>>>>>
                            >>>>>>
                            >>>>No, it won't. But then this is the wrong approach. That's what
                            >>>>server
                            >>>>logs are for.
                            >>>>>
                            >>>I'm expecting only 50 invited visitors or so. Making my own log is more
                            >>>convenient to get a quick look at who showed up, what UA they have etc.
                            >>>>
                            >>>Why would flush() not work? What's the purpose of it then? It does work
                            >>>that
                            >>>way in Tomcat or Resin servlet containers, eg
                            >>>>
                            >>Flush will output current data in the PHP buffers. But you still have
                            >>the web server's buffers, and, since the request is not complete, the
                            >>browser may or may not show the information. This is not Tomcat or
                            >>Resin. And BTW - those don't guarantee all of the output will be
                            >>displayed by the browser immediately. Additionally, the browser will
                            >>still wait for the request to be completed.
                            >>>
                            >>Web servers already have logs to track all of that, and there are lots
                            >>of tools around to give you the information you want.
                            >>>
                            so, you are saying the assumptions of code like the following are
                            flawed?

                            blah blah blah...

                            print '</body></html>';

                            ob_end_flush();

                            // do this after the html so it does not delay
                            // the page loading and can be used next time.
                            // we are only seeing if it returns the name of a machine
                            // on the network rather than the ip address, so that
                            // for whitehall, it's easier to identify the machine that may
                            // be locking the diary.
                            if(!isset($_SES SION['strRemoteName'])){
                            // only do this once, since it won't change during a session.
                            $_SESSION['strRemoteName']= GetRemoteAddrNa me();
                            }

                            <end of file>
                            >
                            That is correct. The assumptions are flawed.
                            >
                            And please don't top post.
                            >
                            >
                            --
                            =============== ===
                            Remove the "x" from my email address
                            Jerry Stuckle
                            JDS Computer Training Corp.
                            jstucklex@attgl obal.net
                            =============== ===
                            >

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: gethostbyaddr() bottleneck?

                              Joe Butler wrote:
                              "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                              news:g9gobe$6b4 $3@registered.m otzarella.org.. .
                              >Joe Butler wrote:
                              >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                              >>news:g9f5m0$d 4s$1@registered .motzarella.org ...
                              >>>RJ_32 wrote:
                              >>>>Jerry Stuckle wrote:
                              >>>>>RJ_32 wrote:
                              >>>>>>Jerry Stuckle wrote:
                              >>>>>>>RJ_32 wrote:
                              >>>>>>>>When there is no rDNS record on an IP address, then it might take a
                              >>>>>>>>while for
                              >>>>>>>>the reverse lookup to timeout. I'm thinking of how on a tracert you
                              >>>>>>>>can
                              >>>>>>>>obser ve the delay.
                              >>>>>>>>>
                              >>>>>>>>If so, then calling gethostbyaddr() can delay the serving of the
                              >>>>>>>>web
                              >>>>>>>>page,
                              >>>>>>>>right ? Because gethostbyaddr() is not forked into a separate
                              >>>>>>>>process .
                              >>>>>>>>So I
                              >>>>>>>>suppo se I'd need to call gethostbyaddr() as the very last task for
                              >>>>>>>>a
                              >>>>>>>>scrip t.
                              >>>>>>>>Does that sound right? Or is there another way around the delay?
                              >>>>>>>>>
                              >>>>>>>Why are you even trying to call gethostbyaddr() ? What do you need
                              >>>>>>>it
                              >>>>>>>for in your page?
                              >>>>>>just for a log to get an idea of where the visitors are coming from.
                              >>>>>>>
                              >>>>>>I'd alternatively thought of maybe running a separate batch so to
                              >>>>>>speak when I
                              >>>>>>wanted to inspect the log.
                              >>>>>>>
                              >>>>>>>And even if it's the last thing on your page, it will still delay
                              >>>>>>>delive ry of the page content.
                              >>>>>>Then would flush() solve that?
                              >>>>>>>
                              >>>>>>>
                              >>>>>No, it won't. But then this is the wrong approach. That's what
                              >>>>>server
                              >>>>>logs are for.
                              >>>>>>
                              >>>>I'm expecting only 50 invited visitors or so. Making my own log is more
                              >>>>convenien t to get a quick look at who showed up, what UA they have etc.
                              >>>>>
                              >>>>Why would flush() not work? What's the purpose of it then? It does work
                              >>>>that
                              >>>>way in Tomcat or Resin servlet containers, eg
                              >>>>>
                              >>>Flush will output current data in the PHP buffers. But you still have
                              >>>the web server's buffers, and, since the request is not complete, the
                              >>>browser may or may not show the information. This is not Tomcat or
                              >>>Resin. And BTW - those don't guarantee all of the output will be
                              >>>displayed by the browser immediately. Additionally, the browser will
                              >>>still wait for the request to be completed.
                              >>>>
                              >>>Web servers already have logs to track all of that, and there are lots
                              >>>of tools around to give you the information you want.
                              >>>>
                              >>so, you are saying the assumptions of code like the following are
                              >>flawed?
                              >>>
                              >>blah blah blah...
                              >>>
                              >> print '</body></html>';
                              >>>
                              >> ob_end_flush();
                              >>>
                              >> // do this after the html so it does not delay
                              >> // the page loading and can be used next time.
                              >> // we are only seeing if it returns the name of a machine
                              >> // on the network rather than the ip address, so that
                              >> // for whitehall, it's easier to identify the machine that may
                              >> // be locking the diary.
                              >> if(!isset($_SES SION['strRemoteName'])){
                              >> // only do this once, since it won't change during a session.
                              >> $_SESSION['strRemoteName']= GetRemoteAddrNa me();
                              >> }
                              >>>
                              >><end of file>
                              >>>
                              >That is correct. The assumptions are flawed.
                              >>
                              >And please don't top post.
                              >>
                              >>
                              I don't think the assumptions are flawed.
                              >
                              I just did a test:
                              >
                              print "blah blah..."
                              >
                              print "</body></html>";
                              >
                              sleep(5);
                              >
                              print "something else";
                              >
                              Now, when I monitor the network packets, my page completes as expected
                              and renders in a timely fashion. 5 seconds later, I get "something
                              else" and that is appended to the end of the rendered page and the
                              network packets comfirm that it is 5 seconds after the first packet
                              for the page was delivered. The browser did still show, "page
                              loading" in the status bar, though.
                              >
                              Without the sleep, it seems that "something else" can get stuck into
                              the same final page network packet. So, I'm guessing that, for
                              efficiency, if Apache has some buffered data due to be sent out, and
                              more unbuffered output is generated before that has been sent, that it
                              will be appended to the data that has not yet been passed on to the
                              network transmission.
                              >
                              So, it seems that it is worthwhile doing a lookup after the final page
                              flush, as there is nothing to loose. Particularly if you are not
                              outputing more data to the user, but simply doing some extra work,
                              such as logging (for 50 users a day).
                              >
                              This was a linux Apache and the browser was Firefox 1.5.
                              >
                              (Top posting fixed)

                              I will respond when you learn not to top post - as you were so nicely asked.

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...