By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,008 Members | 2,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,008 IT Pros & Developers. It's quick & easy.

gethostbyaddr() bottleneck?

P: n/a
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
Share this Question
Share on Google+
24 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
>
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.