Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 71203 invoked by uid 500); 5 Sep 2002 15:41:58 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 71155 invoked from network); 5 Sep 2002 15:41:56 -0000 Sender: trawick@cs390-1.raleigh.ibm.com Message-ID: <3D777BB8.40157F69@attglobal.net> Date: Thu, 05 Sep 2002 11:43:52 -0400 From: Jeff Trawick X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en-US MIME-Version: 1.0 To: dev@httpd.apache.org Subject: IPv6 capability and name lookup cost Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N (this discussion assumes Apache has IPv6 capability) There are some situations during normal web server operation where resolver calls are made to find addresses associated with names and we have no clue whether or not the name has an IPv6 address associated with it. Forward proxy is a good example of this. apr_sockaddr_info_get() will return all addresses associated with the name, and some existing resolvers first do IPv4 name lookup followed by IPv6 name lookup in order to implement this. The lack of overlap results in higher elapsed time; the inability to bundle the queries in a single flow results in higher kernel/library CPU. A resolver cache can help with this. In most cases, there is no IPv6 address. In some cases where there is an IPv6 address, using the IPv4 address would be sufficient. A useful performance improvement can be achieved by allowing the administrator to select the following algorithm: lookup IPv4 if at least one IPv4 address was found, we're done lookup IPv6 The benefit is clear. The drawback is that if IPv4 addresses were found but those addresses are not usable (e.g., IPv4 addresses disabled on that machine but admin didn't remove from DNS), we wouldn't then be able to try the IPv6 addresses (without much more work). (But the admin chose the behavior so what do I care :) ) The bulk of the implementation would be in APR (new flag to apr_sockaddr_info_get()), but Apache would have a configuration mechanism to allow the administrator to turn on the flag. Up for discussion would be if there is an Apache-wide preference or whether different components/modules (core, mod_proxy_foo, etc.) should have separate knobs. Personally I'd prefer an Apache-wide preference which would be respected by core and by any modules distributed by us. Any 3rd-party modules could/should respect the configuration too. Comments? (If APR has no IPv6 capability, the new processing flag would be ignored since we're only going to do the IPv4 lookup anyway.) -- Jeff Trawick