gethostbyaddr() bottleneck?

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

    #16
    Re: gethostbyaddr() bottleneck?


    "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
    news:g9hama$dd1 $1@registered.m otzarella.org.. .
    Joe Butler wrote:
    >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
    >news:g9gobe$6b 4$3@registered. motzarella.org. ..
    >>Joe Butler wrote:
    >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
    >>>news:g9f5m0$ d4s$1@registere d.motzarella.or g...
    >>>>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
    >>>>>>>>>migh t take a
    >>>>>>>>>whil e for
    >>>>>>>>>the reverse lookup to timeout. I'm thinking of how on a
    >>>>>>>>>tracer t you can
    >>>>>>>>>observ e the delay.
    >>>>>>>>>>
    >>>>>>>>>If so, then calling gethostbyaddr() can delay the serving
    >>>>>>>>>of the web
    >>>>>>>>>page ,
    >>>>>>>>>righ t? Because gethostbyaddr() is not forked into a
    >>>>>>>>>separa te process.
    >>>>>>>>>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
    >>>>>>>>>dela y?
    >>>>>>>>>>
    >>>>>>>>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
    >>>>>convenie nt 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.
    >>>>Additionall y, 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.

    LOL in your face!

    Ries


    Comment

    • Jerry Stuckle

      #17
      Re: gethostbyaddr() bottleneck?

      Richard wrote:
      "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
      news:g9hama$dd1 $1@registered.m otzarella.org.. .
      >Joe Butler wrote:
      >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
      >>news:g9gobe$6 b4$3@registered .motzarella.org ...
      >>>Joe Butler wrote:
      >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
      >>>>news:g9f5m0 $d4s$1@register ed.motzarella.o rg...
      >>>>>RJ_32 wrote:
      >>>>>>Jerry Stuckle wrote:
      >>>>>>>RJ_32 wrote:
      >>>>>>>>Jerry Stuckle wrote:
      >>>>>>>>>RJ_3 2 wrote:
      >>>>>>>>>>Whe n there is no rDNS record on an IP address, then it
      >>>>>>>>>>mig ht take a
      >>>>>>>>>>whi le for
      >>>>>>>>>>the reverse lookup to timeout. I'm thinking of how on a
      >>>>>>>>>>trace rt you can
      >>>>>>>>>>obser ve the delay.
      >>>>>>>>>>>
      >>>>>>>>>>If so, then calling gethostbyaddr() can delay the serving
      >>>>>>>>>>of the web
      >>>>>>>>>>pag e,
      >>>>>>>>>>right ? Because gethostbyaddr() is not forked into a
      >>>>>>>>>>separ ate process.
      >>>>>>>>>>So I
      >>>>>>>>>>suppo se I'd need to call gethostbyaddr() as the very last
      >>>>>>>>>>tas k for a
      >>>>>>>>>>scrip t.
      >>>>>>>>>>Doe s 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
      >>>>>>>>comin g from.
      >>>>>>>>>
      >>>>>>>>I'd alternatively thought of maybe running a separate batch
      >>>>>>>>so to
      >>>>>>>>speak when I
      >>>>>>>>wante d to inspect the log.
      >>>>>>>>>
      >>>>>>>>>And even if it's the last thing on your page, it will still
      >>>>>>>>>dela y
      >>>>>>>>>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.
      >>>>>Additional ly, the browser will still wait for the request to be
      >>>>>complete d.
      >>>>>>
      >>>>>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.
      >
      >
      LOL in your face!
      >
      Ries
      >
      >
      >
      Thank you for following the conventions of this (and most) usenet
      newsgroups.

      As for your comments. It may have worked in your particular case - but
      it is very dependent on a lot of things - like which webserver is being
      used, which Apache modules are being loaded, how the OS is configured
      and about 50 other things.

      All the flush() command does is empty the PHP buffers. There is nothing
      to say that the web server and/or OS have not buffered the data, and
      there is no way to force them to clear their buffers.

      Additionally, the </htmlis not necessarily the end of the data - it is
      entirely possible to send more data after that, even though it results
      in invalid html.

      On the client side, your browser (which is quite old, BTW) happens to
      display the data at this time. But that also doesn't mean other
      browsers will - or even a newer version of your current browser.
      Browsers are not required to render the page until all data has been sent.

      And finally - if the data does get sent and the browser does display the
      data, clicking on a link to go back to the same server can interrupt
      (and terminate) the script which is still executing, depending on
      factors such as your php.ini settings.

      So although it worked in your case, that only means it works in your
      particular case - and then not very well. Change the environment and it
      may not work.

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

      Comment

      • Richard

        #18
        Re: gethostbyaddr() bottleneck?


        "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        news:g9hl1t$2s2 $1@registered.m otzarella.org.. .
        Richard wrote:
        >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        >news:g9hama$dd 1$1@registered. motzarella.org. ..
        >>Joe Butler wrote:
        >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        >>>news:g9gobe$ 6b4$3@registere d.motzarella.or g...
        >>>>Joe Butler wrote:
        >>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        >>>>>news:g9f5m 0$d4s$1@registe red.motzarella. org...
        >>>>>>RJ_32 wrote:
        >>>>>>>Jerry Stuckle wrote:
        >>>>>>>>RJ_32 wrote:
        >>>>>>>>>Jerr y Stuckle wrote:
        >>>>>>>>>>RJ_ 32 wrote:
        >>>>>>>>>>>Wh en there is no rDNS record on an IP address, then it
        >>>>>>>>>>>migh t take a
        >>>>>>>>>>>whil e for
        >>>>>>>>>>>th e reverse lookup to timeout. I'm thinking of how on a
        >>>>>>>>>>>trac ert you can
        >>>>>>>>>>>obse rve the delay.
        >>>>>>>>>>>>
        >>>>>>>>>>>If so, then calling gethostbyaddr() can delay the serving
        >>>>>>>>>>>of the web
        >>>>>>>>>>>page ,
        >>>>>>>>>>>righ t? Because gethostbyaddr() is not forked into a
        >>>>>>>>>>>sepa rate process.
        >>>>>>>>>>>So I
        >>>>>>>>>>>supp ose I'd need to call gethostbyaddr() as the very last
        >>>>>>>>>>>ta sk for a
        >>>>>>>>>>>scri pt.
        >>>>>>>>>>>Do es that sound right? Or is there another way around the
        >>>>>>>>>>>dela y?
        >>>>>>>>>>>>
        >>>>>>>>>>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
        >>>>>>>>>comi ng from.
        >>>>>>>>>>
        >>>>>>>>>I'd alternatively thought of maybe running a separate batch
        >>>>>>>>>so to
        >>>>>>>>>spea k when I
        >>>>>>>>>want ed to inspect the log.
        >>>>>>>>>>
        >>>>>>>>>>And even if it's the last thing on your page, it will
        >>>>>>>>>>sti ll delay
        >>>>>>>>>>deliv ery 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
        >>>>>>>convenie nt 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
        >>>>>>immediate ly. 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.
        >>
        >>
        >LOL in your face!
        >>
        >Ries
        >
        Thank you for following the conventions of this (and most) usenet
        newsgroups.
        >
        Please sit down, take a deep breath, and have a coffee.
        Now read my name again and compare with the OP name.

        I really prefer it if you would top post. It is just my preference. It
        makes reading posts easier, especially with long threads.
        I guess we should discuss this once more. Agreed?

        Richard.




        Comment

        • Jerry Stuckle

          #19
          Re: gethostbyaddr() bottleneck?

          Richard wrote:
          "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
          news:g9hl1t$2s2 $1@registered.m otzarella.org.. .
          >Richard wrote:
          >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
          >>news:g9hama$d d1$1@registered .motzarella.org ...
          >>>Joe Butler wrote:
          >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
          >>>>news:g9gobe $6b4$3@register ed.motzarella.o rg...
          >>>>>Joe Butler wrote:
          >>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
          >>>>>>news:g9f5 m0$d4s$1@regist ered.motzarella .org...
          >>>>>>>RJ_32 wrote:
          >>>>>>>>Jerry Stuckle wrote:
          >>>>>>>>>RJ_3 2 wrote:
          >>>>>>>>>>Jer ry Stuckle wrote:
          >>>>>>>>>>>RJ_3 2 wrote:
          >>>>>>>>>>>>Whe n there is no rDNS record on an IP address, then it
          >>>>>>>>>>>>mig ht take a
          >>>>>>>>>>>>whi le for
          >>>>>>>>>>>>t he reverse lookup to timeout. I'm thinking of how on a
          >>>>>>>>>>>>tra cert you can
          >>>>>>>>>>>>obs erve the delay.
          >>>>>>>>>>>>>
          >>>>>>>>>>>>I f so, then calling gethostbyaddr() can delay the serving
          >>>>>>>>>>>>o f the web
          >>>>>>>>>>>>pag e,
          >>>>>>>>>>>>rig ht? Because gethostbyaddr() is not forked into a
          >>>>>>>>>>>>sep arate process.
          >>>>>>>>>>>>S o I
          >>>>>>>>>>>>sup pose I'd need to call gethostbyaddr() as the very last
          >>>>>>>>>>>>tas k for a
          >>>>>>>>>>>>scr ipt.
          >>>>>>>>>>>>Doe s that sound right? Or is there another way around the
          >>>>>>>>>>>>del ay?
          >>>>>>>>>>>>>
          >>>>>>>>>>>Wh y are you even trying to call gethostbyaddr() ? What do
          >>>>>>>>>>>yo u need it
          >>>>>>>>>>>fo r in your page?
          >>>>>>>>>>jus t for a log to get an idea of where the visitors are
          >>>>>>>>>>comin g from.
          >>>>>>>>>>>
          >>>>>>>>>>I'd alternatively thought of maybe running a separate batch
          >>>>>>>>>>so to
          >>>>>>>>>>spe ak when I
          >>>>>>>>>>wante d to inspect the log.
          >>>>>>>>>>>
          >>>>>>>>>>>An d even if it's the last thing on your page, it will
          >>>>>>>>>>>stil l delay
          >>>>>>>>>>>deli very of the page content.
          >>>>>>>>>>The n 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
          >>>>>>>>conveni ent 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
          >>>>>>>immediat ely. Additionally, the browser will still wait for the
          >>>>>>>reques t 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
          >>>>"somethin g
          >>>>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
          >>>>efficienc y, 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.
          >>>
          >>LOL in your face!
          >>>
          >>Ries
          >Thank you for following the conventions of this (and most) usenet
          >newsgroups.
          >>
          >
          Please sit down, take a deep breath, and have a coffee.
          Now read my name again and compare with the OP name.
          >
          I really prefer it if you would top post. It is just my preference. It
          makes reading posts easier, especially with long threads.
          I guess we should discuss this once more. Agreed?
          >
          Richard.
          >
          >
          >
          >
          >
          No discussion. Whether you prefer top posting or not is immaterial.
          The convention for this and most usenet newsgroups is bottom posting.
          Top posting will quickly get you no responses.

          And sorry - I did mix you up with Joe. It happens sometimes when I'm in
          a hurry.

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

          Comment

          • Richard

            #20
            Re: gethostbyaddr() bottleneck?


            "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            news:g9i1bh$i61 $1@registered.m otzarella.org.. .
            Richard wrote:
            >"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            >news:g9hl1t$2s 2$1@registered. motzarella.org. ..
            >>Richard wrote:
            >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            >>>news:g9hama$ dd1$1@registere d.motzarella.or g...
            >>>>Joe Butler wrote:
            >>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            >>>>>news:g9gob e$6b4$3@registe red.motzarella. org...
            >>>>>>Joe Butler wrote:
            >>>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
            >>>>>>>news:g9f 5m0$d4s$1@regis tered.motzarell a.org...
            >>>>>>>>RJ_32 wrote:
            >>>>>>>>>Jerr y Stuckle wrote:
            >>>>>>>>>>RJ_ 32 wrote:
            >>>>>>>>>>>Jerr y Stuckle wrote:
            >>>>>>>>>>>>RJ_ 32 wrote:
            >>>>>>>>>>>>>Wh en there is no rDNS record on an IP address, then it
            >>>>>>>>>>>>>mi ght take a
            >>>>>>>>>>>>>wh ile for
            >>>>>>>>>>>>>th e reverse lookup to timeout. I'm thinking of how on a
            >>>>>>>>>>>>>tr acert you can
            >>>>>>>>>>>>>ob serve the delay.
            >>>>>>>>>>>>> >
            >>>>>>>>>>>>> If so, then calling gethostbyaddr() can delay the
            >>>>>>>>>>>>>se rving of the web
            >>>>>>>>>>>>>pa ge,
            >>>>>>>>>>>>>ri ght? Because gethostbyaddr() is not forked into a
            >>>>>>>>>>>>>se parate process.
            >>>>>>>>>>>>> So I
            >>>>>>>>>>>>>su ppose I'd need to call gethostbyaddr() as the very
            >>>>>>>>>>>>>la st task for a
            >>>>>>>>>>>>>sc ript.
            >>>>>>>>>>>>>Do es that sound right? Or is there another way around
            >>>>>>>>>>>>>th e delay?
            >>>>>>>>>>>>> >
            >>>>>>>>>>>>W hy are you even trying to call gethostbyaddr() ? What
            >>>>>>>>>>>>d o you need it
            >>>>>>>>>>>>f or in your page?
            >>>>>>>>>>>ju st for a log to get an idea of where the visitors are
            >>>>>>>>>>>comi ng from.
            >>>>>>>>>>>>
            >>>>>>>>>>>I' d alternatively thought of maybe running a separate
            >>>>>>>>>>>batc h so to
            >>>>>>>>>>>spea k when I
            >>>>>>>>>>>want ed to inspect the log.
            >>>>>>>>>>>>
            >>>>>>>>>>>>A nd even if it's the last thing on your page, it will
            >>>>>>>>>>>>sti ll delay
            >>>>>>>>>>>>del ivery of the page content.
            >>>>>>>>>>>Th en would flush() solve that?
            >>>>>>>>>>>>
            >>>>>>>>>>>>
            >>>>>>>>>>No, it won't. But then this is the wrong approach.
            >>>>>>>>>>That' s what server
            >>>>>>>>>>log s are for.
            >>>>>>>>>>>
            >>>>>>>>>I'm expecting only 50 invited visitors or so. Making my own
            >>>>>>>>>log is more
            >>>>>>>>>conven ient 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
            >>>>>>>>informa tion. This is not Tomcat or Resin. And BTW - those
            >>>>>>>>don't guarantee all of the output will be displayed by the
            >>>>>>>>brows er 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
            >>>>>>>sessio n.
            >>>>>>> $_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
            >>>>>"somethi ng
            >>>>>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
            >>>>>outputin g 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.
            >>>>
            >>>LOL in your face!
            >>>>
            >>>Ries
            >>Thank you for following the conventions of this (and most) usenet
            >>newsgroups.
            >>>
            >>
            >Please sit down, take a deep breath, and have a coffee.
            >Now read my name again and compare with the OP name.
            >>
            >I really prefer it if you would top post. It is just my preference.
            >It makes reading posts easier, especially with long threads.
            >I guess we should discuss this once more. Agreed?
            >>
            >Richard.
            >>
            >>
            >>
            >>
            >>
            >
            No discussion. Whether you prefer top posting or not is immaterial.
            The convention for this and most usenet newsgroups is bottom
            posting. Top posting will quickly get you no responses.
            >
            And sorry - I did mix you up with Joe. It happens sometimes when
            I'm in a hurry.
            >
            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===
            >
            Dont worry.
            He is already gone.
            Like many the others insulted out of this group.
            Any idea why usenet is dead?

            Richard


            Comment

            • Jerry Stuckle

              #21
              Re: gethostbyaddr() bottleneck?

              Richard wrote:
              "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              news:g9i1bh$i61 $1@registered.m otzarella.org.. .
              >Richard wrote:
              >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              >>news:g9hl1t$2 s2$1@registered .motzarella.org ...
              >>>Richard wrote:
              >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              >>>>news:g9hama $dd1$1@register ed.motzarella.o rg...
              >>>>>Joe Butler wrote:
              >>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              >>>>>>news:g9go be$6b4$3@regist ered.motzarella .org...
              >>>>>>>Joe Butler wrote:
              >>>>>>>>"Jerr y Stuckle" <jstucklex@attg lobal.netwrote in message
              >>>>>>>>news:g9 f5m0$d4s$1@regi stered.motzarel la.org...
              >>>>>>>>>RJ_3 2 wrote:
              >>>>>>>>>>Jer ry Stuckle wrote:
              >>>>>>>>>>>RJ_3 2 wrote:
              >>>>>>>>>>>>Jer ry Stuckle wrote:
              >>>>>>>>>>>>>RJ _32 wrote:
              >>>>>>>>>>>>>>W hen there is no rDNS record on an IP address, then it
              >>>>>>>>>>>>>>m ight take a
              >>>>>>>>>>>>>>w hile for
              >>>>>>>>>>>>>>t he reverse lookup to timeout. I'm thinking of how on a
              >>>>>>>>>>>>>>t racert you can
              >>>>>>>>>>>>>>o bserve the delay.
              >>>>>>>>>>>>> >>
              >>>>>>>>>>>>>>I f so, then calling gethostbyaddr() can delay the
              >>>>>>>>>>>>>>s erving of the web
              >>>>>>>>>>>>>>p age,
              >>>>>>>>>>>>>>r ight? Because gethostbyaddr() is not forked into a
              >>>>>>>>>>>>>>s eparate process.
              >>>>>>>>>>>>>>S o I
              >>>>>>>>>>>>>>s uppose I'd need to call gethostbyaddr() as the very
              >>>>>>>>>>>>>>l ast task for a
              >>>>>>>>>>>>>>s cript.
              >>>>>>>>>>>>>>D oes that sound right? Or is there another way around
              >>>>>>>>>>>>>>t he delay?
              >>>>>>>>>>>>> >>
              >>>>>>>>>>>>>Wh y are you even trying to call gethostbyaddr() ? What
              >>>>>>>>>>>>> do you need it
              >>>>>>>>>>>>>fo r in your page?
              >>>>>>>>>>>>jus t for a log to get an idea of where the visitors are
              >>>>>>>>>>>>com ing from.
              >>>>>>>>>>>>>
              >>>>>>>>>>>>I 'd alternatively thought of maybe running a separate
              >>>>>>>>>>>>bat ch so to
              >>>>>>>>>>>>spe ak when I
              >>>>>>>>>>>>wan ted to inspect the log.
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>An d even if it's the last thing on your page, it will
              >>>>>>>>>>>>>st ill delay
              >>>>>>>>>>>>>de livery of the page content.
              >>>>>>>>>>>>The n would flush() solve that?
              >>>>>>>>>>>>>
              >>>>>>>>>>>>>
              >>>>>>>>>>>No , it won't. But then this is the wrong approach.
              >>>>>>>>>>>That 's what server
              >>>>>>>>>>>lo gs are for.
              >>>>>>>>>>>>
              >>>>>>>>>>I'm expecting only 50 invited visitors or so. Making my own
              >>>>>>>>>>log is more
              >>>>>>>>>>conve nient to get a quick look at who showed up, what UA
              >>>>>>>>>>the y 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
              >>>>>>>>>>>
              >>>>>>>>>Flus h will output current data in the PHP buffers. But you
              >>>>>>>>>stil l have the web server's buffers, and, since the request
              >>>>>>>>>is not complete, the browser may or may not show the
              >>>>>>>>>inform ation. This is not Tomcat or Resin. And BTW - those
              >>>>>>>>>don' t guarantee all of the output will be displayed by the
              >>>>>>>>>browse r immediately. Additionally, the browser will still
              >>>>>>>>>wait for the request to be completed.
              >>>>>>>>>>
              >>>>>>>>>Web servers already have logs to track all of that, and
              >>>>>>>>>ther e are lots of tools around to give you the information
              >>>>>>>>>you want.
              >>>>>>>>>>
              >>>>>>>>so, you are saying the assumptions of code like the following
              >>>>>>>>are
              >>>>>>>>flawe d?
              >>>>>>>>>
              >>>>>>>>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
              >>>>>>expecte d
              >>>>>>and renders in a timely fashion. 5 seconds later, I get
              >>>>>>"somethin g
              >>>>>>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
              >>>>>>efficienc y, 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
              >>>>>>outputi ng 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.
              >>>>LOL in your face!
              >>>>>
              >>>>Ries
              >>>Thank you for following the conventions of this (and most) usenet
              >>>newsgroups .
              >>>>
              >>Please sit down, take a deep breath, and have a coffee.
              >>Now read my name again and compare with the OP name.
              >>>
              >>I really prefer it if you would top post. It is just my preference.
              >>It makes reading posts easier, especially with long threads.
              >>I guess we should discuss this once more. Agreed?
              >>>
              >>Richard.
              >>>
              >>>
              >>>
              >>>
              >>>
              >No discussion. Whether you prefer top posting or not is immaterial.
              >The convention for this and most usenet newsgroups is bottom
              >posting. Top posting will quickly get you no responses.
              >>
              >And sorry - I did mix you up with Joe. It happens sometimes when
              >I'm in a hurry.
              >>
              >--
              >============== ====
              >Remove the "x" from my email address
              >Jerry Stuckle
              >JDS Computer Training Corp.
              >jstucklex@attgl obal.net
              >============== ====
              >>
              >
              Dont worry.
              He is already gone.
              Like many the others insulted out of this group.
              Any idea why usenet is dead?
              >
              Richard
              >
              >
              >
              No, he's not gone. But if he doesn't want to follow even the simplest
              usenet conventions, then he won't fit in, anyway.

              I don't find usenet to be dead at all. And BTW - I never insulted him.
              I just refused to answer him until he started following established
              conventions. They're there for a reason.

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

              Comment

              • Joe Butler

                #22
                Re: gethostbyaddr() bottleneck?

                Richard, you are that one that said, "Lots of love in your face" to Jerry.
                That sounds a bit yucky to me.

                "Richard" <root@localhost wrote in message
                news:48bd3717$0 $76916$dbd49001 @news.euronet.n l...
                >
                "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                news:g9i1bh$i61 $1@registered.m otzarella.org.. .
                >Richard wrote:
                >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                >>news:g9hl1t$2 s2$1@registered .motzarella.org ...
                >>>Richard wrote:
                >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                >>>>news:g9hama $dd1$1@register ed.motzarella.o rg...
                >>>>>Joe Butler wrote:
                >>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                >>>>>>news:g9go be$6b4$3@regist ered.motzarella .org...
                >>>>>>>Joe Butler wrote:
                >>>>>>>>"Jerr y Stuckle" <jstucklex@attg lobal.netwrote in message
                >>>>>>>>news:g9 f5m0$d4s$1@regi stered.motzarel la.org...
                >>>>>>>>>RJ_3 2 wrote:
                >>>>>>>>>>Jer ry Stuckle wrote:
                >>>>>>>>>>>RJ_3 2 wrote:
                >>>>>>>>>>>>Jer ry Stuckle wrote:
                >>>>>>>>>>>>>RJ _32 wrote:
                >>>>>>>>>>>>>>W hen there is no rDNS record on an IP address, then it might
                >>>>>>>>>>>>>>t ake a
                >>>>>>>>>>>>>>w hile for
                >>>>>>>>>>>>>>t he reverse lookup to timeout. I'm thinking of how on a
                >>>>>>>>>>>>>>t racert you can
                >>>>>>>>>>>>>>o bserve the delay.
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>>I f so, then calling gethostbyaddr() can delay the serving of
                >>>>>>>>>>>>>>t he web
                >>>>>>>>>>>>>>p age,
                >>>>>>>>>>>>>>r ight? Because gethostbyaddr() is not forked into a separate
                >>>>>>>>>>>>>>p rocess.
                >>>>>>>>>>>>>>S o I
                >>>>>>>>>>>>>>s uppose I'd need to call gethostbyaddr() as the very last
                >>>>>>>>>>>>>>t ask for a
                >>>>>>>>>>>>>>s cript.
                >>>>>>>>>>>>>>D oes that sound right? Or is there another way around the
                >>>>>>>>>>>>>>d elay?
                >>>>>>>>>>>>> >>
                >>>>>>>>>>>>>Wh y are you even trying to call gethostbyaddr() ? What do you
                >>>>>>>>>>>>>ne ed it
                >>>>>>>>>>>>>fo r in your page?
                >>>>>>>>>>>>jus t for a log to get an idea of where the visitors are coming
                >>>>>>>>>>>>fro m.
                >>>>>>>>>>>>>
                >>>>>>>>>>>>I 'd alternatively thought of maybe running a separate batch so
                >>>>>>>>>>>>t o
                >>>>>>>>>>>>spe ak when I
                >>>>>>>>>>>>wan ted to inspect the log.
                >>>>>>>>>>>>>
                >>>>>>>>>>>>>An d even if it's the last thing on your page, it will still
                >>>>>>>>>>>>>de lay
                >>>>>>>>>>>>>de livery of the page content.
                >>>>>>>>>>>>The n would flush() solve that?
                >>>>>>>>>>>>>
                >>>>>>>>>>>>>
                >>>>>>>>>>>No , it won't. But then this is the wrong approach. That's what
                >>>>>>>>>>>serv er
                >>>>>>>>>>>lo gs are for.
                >>>>>>>>>>>>
                >>>>>>>>>>I'm expecting only 50 invited visitors or so. Making my own log
                >>>>>>>>>>is more
                >>>>>>>>>>conve nient to get a quick look at who showed up, what UA they
                >>>>>>>>>>hav e etc.
                >>>>>>>>>>>
                >>>>>>>>>>Why would flush() not work? What's the purpose of it then? It
                >>>>>>>>>>doe s work that
                >>>>>>>>>>way in Tomcat or Resin servlet containers, eg
                >>>>>>>>>>>
                >>>>>>>>>Flus h will output current data in the PHP buffers. But you still
                >>>>>>>>>have the web server's buffers, and, since the request is not
                >>>>>>>>>comple te, 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.
                >>>>>>>>>Additi onally, the browser will still wait for the request to be
                >>>>>>>>>comple ted.
                >>>>>>>>>>
                >>>>>>>>>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
                >>>>>>>>flawe d?
                >>>>>>>>>
                >>>>>>>>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
                >>>>>>expecte d
                >>>>>>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
                >>>>>>efficienc y, 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
                >>>>>>outputi ng 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.
                >>>>>
                >>>>LOL in your face!
                >>>>>
                >>>>Ries
                >>>Thank you for following the conventions of this (and most) usenet
                >>>newsgroups .
                >>>>
                >>>
                >>Please sit down, take a deep breath, and have a coffee.
                >>Now read my name again and compare with the OP name.
                >>>
                >>I really prefer it if you would top post. It is just my preference. It
                >>makes reading posts easier, especially with long threads.
                >>I guess we should discuss this once more. Agreed?
                >>>
                >>Richard.
                >>>
                >>>
                >>>
                >>>
                >>>
                >>
                >No discussion. Whether you prefer top posting or not is immaterial. The
                >convention for this and most usenet newsgroups is bottom posting. Top
                >posting will quickly get you no responses.
                >>
                >And sorry - I did mix you up with Joe. It happens sometimes when I'm in
                >a hurry.
                >>
                >--
                >============== ====
                >Remove the "x" from my email address
                >Jerry Stuckle
                >JDS Computer Training Corp.
                >jstucklex@attgl obal.net
                >============== ====
                >>
                >
                Dont worry.
                He is already gone.
                Like many the others insulted out of this group.
                Any idea why usenet is dead?
                >
                Richard
                >

                Comment

                • Richard

                  #23
                  Re: gethostbyaddr() bottleneck?

                  >
                  No, he's not gone. But if he doesn't want to follow even the
                  simplest usenet conventions, then he won't fit in, anyway.
                  >
                  I don't find usenet to be dead at all. And BTW - I never insulted
                  him. I just refused to answer him until he started following
                  established conventions. They're there for a reason.
                  As if you are the one to decide on who fits where. I think not.
                  Sad to see you are slapping someone with "convention s", but dont keep
                  to them yourself.
                  What do the conventions say about quoting?

                  To me, the dynamics of the groups was effectively killed when the
                  "rules" were "formalised ".
                  The online world has changed and those "rules" are antics.
                  People have moved on to friendlier places.

                  I call this an insult:
                  >>>>>I will respond when you learn not to top post - as you were so
                  >>>>>nicely asked.
                  Hardly anyone would post again. You simply go somewhere else where the
                  people are less hostile.

                  Richard




                  Comment

                  • Jerry Stuckle

                    #24
                    Re: gethostbyaddr() bottleneck?

                    Richard wrote:
                    >No, he's not gone. But if he doesn't want to follow even the
                    >simplest usenet conventions, then he won't fit in, anyway.
                    >>
                    >I don't find usenet to be dead at all. And BTW - I never insulted
                    >him. I just refused to answer him until he started following
                    >established conventions. They're there for a reason.
                    >
                    As if you are the one to decide on who fits where. I think not.
                    Sad to see you are slapping someone with "convention s", but dont keep
                    to them yourself.
                    What do the conventions say about quoting?
                    >
                    To me, the dynamics of the groups was effectively killed when the
                    "rules" were "formalised ".
                    The online world has changed and those "rules" are antics.
                    People have moved on to friendlier places.
                    >
                    I call this an insult:
                    >>>>>>I will respond when you learn not to top post - as you were so
                    >>>>>>nicely asked.
                    >
                    Hardly anyone would post again. You simply go somewhere else where the
                    people are less hostile.
                    >
                    Richard
                    >
                    >
                    >
                    >
                    >
                    I'm not the one who sets the conventions. The newsgroup as a whole
                    does, and in this (and most newsgroups), the convention is to bottom post.

                    And yes, I also have the choice of replying to a post or not doing so.
                    I chose not to reply to his post because he didn't follow the
                    conventions here.

                    You are, of course, free to go somewhere else. But those who don't
                    follow the conventions quickly find they don't get answers to their posts.

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

                    Comment

                    • I V

                      #25
                      Re: gethostbyaddr() bottleneck?

                      On Tue, 02 Sep 2008 14:59:16 -0400, Jerry Stuckle wrote:
                      I'm not the one who sets the conventions. The newsgroup as a whole
                      does, and in this (and most newsgroups), the convention is to bottom
                      post.
                      The convention is also to trim the quoted text, as you surely must be
                      aware.

                      Comment

                      Working...