473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?
Aug 31 '08 #1
24 2466
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.
js*******@attglobal.net
==================

Aug 31 '08 #2
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?

Aug 31 '08 #3
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.
js*******@attglobal.net
==================

Aug 31 '08 #4
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
Aug 31 '08 #5
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.
js*******@attglobal.net
==================

Aug 31 '08 #6
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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}

<end of file>

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>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.
js*******@attglobal.net
==================

Sep 1 '08 #7
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.
Sep 1 '08 #8
On Aug 31, 9:36 pm, RJ_32 <RJ...@none.comwrote:
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.
Sep 1 '08 #9
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.
Sep 1 '08 #10
Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>>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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}

<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.
js*******@attglobal.net
==================

Sep 1 '08 #11
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.
js*******@attglobal.net
==================

Sep 1 '08 #12
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.
Sep 1 '08 #13
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" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Joe Butler wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>>>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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}

<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.
js*******@attglobal.net
==================

Sep 1 '08 #14
Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>Joe Butler wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>>>>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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}

<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.
js*******@attglobal.net
==================

Sep 1 '08 #15

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Joe Butler wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>>Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>>>>>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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}

<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
Sep 1 '08 #16
Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>Joe Butler wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@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
>>>>>>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($_SESSION['strRemoteName'])){
// only do this once, since it won't change during a session.
$_SESSION['strRemoteName']= GetRemoteAddrName();
}
>
<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.
js*******@attglobal.net
==================

Sep 1 '08 #17

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Richard wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>>Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org.. .
Joe Butler wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:g9**********@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
>>>>>>>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($_SESSION['strRemoteName'])){
> // only do this once, since it won't change during a session.
> $_SESSION['strRemoteName']= GetRemoteAddrName();
> }
>>
><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.


Sep 1 '08 #18
Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>Richard wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Joe Butler wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org. ..
>Joe Butler wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:g9**********@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
>>>>>>>>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($_SESSION['strRemoteName'])){
>> // only do this once, since it won't change during a session.
>> $_SESSION['strRemoteName']= GetRemoteAddrName();
>> }
>>>
>><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.


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.
js*******@attglobal.net
==================

Sep 2 '08 #19

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Richard wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>>Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org.. .
Joe Butler wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:g9**********@registered.motzarella.org.. .
>>Joe Butler wrote:
>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>news:g9**********@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
>>>>>>>>>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($_SESSION['strRemoteName'])){
>>> // only do this once, since it won't change during a
>>>session.
>>> $_SESSION['strRemoteName']= GetRemoteAddrName();
>>> }
>>>>
>>><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.



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.
js*******@attglobal.net
==================
Dont worry.
He is already gone.
Like many the others insulted out of this group.
Any idea why usenet is dead?

Richard
Sep 2 '08 #20
Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>Richard wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org. ..
>Joe Butler wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:g9**********@registered.motzarella.org. ..
>>>Joe Butler wrote:
>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>news:g9**********@registered.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
>>>>>>>>>>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($_SESSION['strRemoteName'])){
>>>> // only do this once, since it won't change during a
>>>>session.
>>>> $_SESSION['strRemoteName']= GetRemoteAddrName();
>>>> }
>>>>>
>>>><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.


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.
js*******@attglobal.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.
js*******@attglobal.net
==================

Sep 2 '08 #21
Richard, you are that one that said, "Lots of love in your face" to Jerry.
That sounds a bit yucky to me.

"Richard" <root@localhostwrote in message
news:48***********************@news.euronet.nl...
>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
>Richard wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org...
Richard wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g9**********@registered.motzarella.org. ..
>Joe Butler wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:g9**********@registered.motzarella.org. ..
>>>Joe Butler wrote:
>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>news:g9**********@registered.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 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($_SESSION['strRemoteName'])){
>>>> // only do this once, since it won't change during a session.
>>>> $_SESSION['strRemoteName']= GetRemoteAddrName();
>>>> }
>>>>>
>>>><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.



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.
js*******@attglobal.net
==================

Dont worry.
He is already gone.
Like many the others insulted out of this group.
Any idea why usenet is dead?

Richard

Sep 2 '08 #22
>
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 "conventions", 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


Sep 2 '08 #23
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 "conventions", 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.
js*******@attglobal.net
==================

Sep 2 '08 #24
I V
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.
Sep 2 '08 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3249
by: O.B. | last post by:
What reasons are there for the following returning the IP address instead of the hostname? gethostbyaddr($_SERVER)
0
1607
by: Sibylle Koczian | last post by:
Hello all, the documentation for the socket module says that gethostbyaddr should return the primary host name and alternative host names if there are any. But the alias list is empty even in...
2
2672
by: Neil Aggarwal | last post by:
Hello: I am using gcc on RedHat Linux 9. When I try to do a reverse dns query using gethostbyaddr, it works fine for hosts that have a PTR record, but it returns null for hosts that have a...
1
4983
by: kcw3388 | last post by:
Hi, I have a SunOS TCP/IP client program worked fine for a long time until yesterday. Now, my TCP/IP server program is located on different DNS server. The gethostbyaddr ( ) is now...
2
3175
by: Harlin Seritt | last post by:
I have a list of IP addresses I am testing with socket.gethostbyaddr(). For the most part, I am able to get a hostname returned to me when I run gethostbyaddr(). I am also hoping this will allow me...
0
1409
by: Jørn Dahl-Stamnes | last post by:
I have a PHP script which contain the following code: $hostname = gethostbyaddr ($ip); Until yesterday, the gethostbyaddr returned the hostname of the given IP-addresse. But yesterday it began...
2
3078
by: christian9997 | last post by:
Hi Since yesterday about 11.00 CET the gethostbyaddr function doesn't seem to be working. All I get is the IP address back. Is this something general to all PHP users or is this specific to my...
1
3628
by: shailesh | last post by:
Hi, I am facing a peculiar problem. socket.gethostbyaddr is not working fine on my MAC for ip addresses on the LAN. The LAN happens to consist of linux and windows machines and this is the only...
1
3101
by: lakshmiraja | last post by:
hi, I came to know that gethostbyaddr is deprecated in Visual Studio 2005 by the introduction of getnameinfo function. Can i know the reason for the deprecation of gethostbyaddr function. Is...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.