Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » PHPGoto page 1, 2, 3  Next

gethostbyaddr() bottleneck?

 
Jump to:  
 
RJ_32
PostPosted: Sun Aug 31, 2008 6:36 pm    Post subject: gethostbyaddr() bottleneck?
       
When there is no rDNS record on an IP address, then it might take a while for
the reverse lookup to timeout. I'm thinking of how on a tracert you can
observe the delay.

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

 
Jerry Stuckle
PostPosted: Sun Aug 31, 2008 6:46 pm    Post subject: Re: gethostbyaddr() bottleneck?
       
RJ_32 wrote:
Quote:
When there is no rDNS record on an IP address, then it might take a while for
the reverse lookup to timeout. I'm thinking of how on a tracert you can
observe the delay.

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


Why are you even trying to call gethostbyaddr()? What do you need it
for in your page?

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

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

 
RJ_32
PostPosted: Sun Aug 31, 2008 7:01 pm    Post subject: Re: gethostbyaddr() bottleneck?
       
Jerry Stuckle wrote:
Quote:
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.

Quote:

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?
 

 
Jerry Stuckle
PostPosted: Sun Aug 31, 2008 7:15 pm    Post subject: Re: gethostbyaddr() bottleneck?
       
RJ_32 wrote:
Quote:
Jerry Stuckle wrote:
RJ_32 wrote:
When there is no rDNS record on an IP address, then it might take a
while for
the reverse lookup to timeout. I'm thinking of how on a tracert you can
observe the delay.

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

Why are you even trying to call gethostbyaddr()? What do you need it
for in your page?

just for a log to get an idea of where the visitors are coming from.

I'd alternatively thought of maybe running a separate batch so to speak when I
wanted to inspect the log.

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

Then would flush() solve that?



No, it won't. But then this is the wrong approach. That's what server
logs are for.

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

 
RJ_32
PostPosted: Sun Aug 31, 2008 7:23 pm    Post subject: Re: gethostbyaddr() bottleneck?
       
Jerry Stuckle wrote:
Quote:
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
 

 
Jerry Stuckle
PostPosted: Sun Aug 31, 2008 8:24 pm    Post subject: Re: gethostbyaddr() bottleneck?
       
RJ_32 wrote:
Quote:
Jerry Stuckle wrote:
RJ_32 wrote:
Jerry Stuckle wrote:
RJ_32 wrote:
When there is no rDNS record on an IP address, then it might take a
while for
the reverse lookup to timeout. I'm thinking of how on a tracert you can
observe the delay.

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

Why are you even trying to call gethostbyaddr()? What do you need it
for in your page?
just for a log to get an idea of where the visitors are coming from.

I'd alternatively thought of maybe running a separate batch so to
speak when I
wanted to inspect the log.

And even if it's the last thing on your page, it will still delay
delivery of the page content.
Then would flush() solve that?


No, it won't. But then this is the wrong approach. That's what server
logs are for.


I'm expecting only 50 invited visitors or so. Making my own log is more
convenient to get a quick look at who showed up, what UA they have etc.

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


Flush will output current data in the PHP buffers. But you still have
the web server's buffers, and, since the request is not complete, the
browser may or may not show the information. This is not Tomcat or
Resin. And BTW - those don't guarantee all of the output will be
displayed by the browser immediately. Additionally, the browser will
still wait for the request to be completed.

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

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

 
Joe Butler
PostPosted: Mon Sep 01, 2008 6:36 am    Post subject: Re: gethostbyaddr() bottleneck?
       
so, you are saying the assumptions of code like the following are flawed?

blah blah blah...

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

ob_end_flush();

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

<end of file>

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:g9f5m0$d4s$1@registered.motzarella.org...
Quote:
RJ_32 wrote:
Jerry Stuckle wrote:
RJ_32 wrote:
Jerry Stuckle wrote:
RJ_32 wrote:
When there is no rDNS record on an IP address, then it might take a
while for
the reverse lookup to timeout. I'm thinking of how on a tracert you
can
observe the delay.

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

Why are you even trying to call gethostbyaddr()? What do you need it
for in your page?
just for a log to get an idea of where the visitors are coming from.

I'd alternatively thought of maybe running a separate batch so to
speak when I
wanted to inspect the log.

And even if it's the last thing on your page, it will still delay
delivery of the page content.
Then would flush() solve that?


No, it won't. But then this is the wrong approach. That's what server
logs are for.


I'm expecting only 50 invited visitors or so. Making my own log is more
convenient to get a quick look at who showed up, what UA they have etc.

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


Flush will output current data in the PHP buffers. But you still have the
web server's buffers, and, since the request is not complete, the browser
may or may not show the information. This is not Tomcat or Resin. And
BTW - those don't guarantee all of the output will be displayed by the
browser immediately. Additionally, the browser will still wait for the
request to be completed.

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

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

 
Sjord
PostPosted: Mon Sep 01, 2008 7:15 am    Post subject: Re: gethostbyaddr() bottleneck?
       
On Sun, 31 Aug 2008 17:01:12 -0400, RJ_32 wrote:
Quote:
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.
 

 
Sjoerd
PostPosted: Mon Sep 01, 2008 8:41 am    Post subject: Re: gethostbyaddr() bottleneck?
       
On Mon, 01 Sep 2008 03:13:05 -0700, Gordon wrote:
Quote:
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.
 

 
Gordon
PostPosted: Mon Sep 01, 2008 10:13 am    Post subject: Re: gethostbyaddr() bottleneck?
       
On Aug 31, 9:36 pm, RJ_32 <RJ...@none.com> wrote:
Quote:
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.
 

Page 1 of 3 .:. Goto page 1, 2, 3  Next

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

HP 83 Magenta UV Value Pack idol opony matador Zarządzanie wiedzą Koncepcja i narzędzia health insurance