You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "j.travis" <sk...@psinode.com> on 2004/02/11 18:02:30 UTC

[users@httpd] HostnameLookups

I have read that it is a performance liability to have HostnameLookups
turned on.  What I am wondering is will Apache2 do a
HostnameLookup -before- it responds to a request? (in which case that
could indeed be a very big liability) or does it do it independently of
requests (but just sometime before it gets logged). If this is the case
it seems like it would be only a slight overall use of bandwidth and a
very miniscule performance hit.  It certainly makes the log files more
interesting to browse through...


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HostnameLookups

Posted by Brian Dessent <br...@dessent.net>.
"j.travis" wrote:
> 
> I have read that it is a performance liability to have HostnameLookups
> turned on.  What I am wondering is will Apache2 do a
> HostnameLookup -before- it responds to a request? (in which case that
> could indeed be a very big liability) or does it do it independently of
> requests (but just sometime before it gets logged). If this is the case
> it seems like it would be only a slight overall use of bandwidth and a
> very miniscule performance hit.  It certainly makes the log files more
> interesting to browse through...

If you were using 1.3 you could try mod_dns:
<http://oss.ezic.com/mod_dns/README>  This module supposedly improves
the DNS performance significantly through caching, so that it's feasible
to turn on HostNameLookups again.

But, that aside, there's nothing that says you can't process the logs
offline.  Apache comes with 'logresolve', and there are a number of
other similar and more feature-rich alternatives (adns, bulkdns, etc.)
that are all specifically to do fast reverse DNS lookups with caching,
for log processing.  You can filter your live logs through one of these
programs, and use the output for whatever you want.  Or you can wait
until you rotate the logs and then replace them with the resolved
versions.

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HostnameLookups

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 11 Feb 2004, j.travis wrote:

> I have read that it is a performance liability to have HostnameLookups
> turned on.  What I am wondering is will Apache2 do a
> HostnameLookup -before- it responds to a request? (in which case that
> could indeed be a very big liability) or does it do it independently of
> requests (but just sometime before it gets logged). If this is the case
> it seems like it would be only a slight overall use of bandwidth and a
> very miniscule performance hit.  It certainly makes the log files more
> interesting to browse through...

It must be done before the response in order to fill variables like
REMOTE_HOST that some script rely on.  It must also be done before the
response if any access controls are host-based.

Even if it was done after the response, it would still be a bad idea for a
busy server because it would extend the time that each request ties up a
process, and would also slow keepalive/persistent connections.

Your best bet is to post-process the logs using something like logresolve
(included with apache).  If you reall want the names in near-real-time,
you can pipe your log files through something like logresolve before they
are written to disk.  This gives you the effect of after-response
resolution.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org