From owner-freebsd-arch@FreeBSD.ORG Sun Aug 21 04:04:58 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4586716A420; Sun, 21 Aug 2005 04:04:58 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from mail25.syd.optusnet.com.au (mail25.syd.optusnet.com.au [211.29.133.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96F3443D45; Sun, 21 Aug 2005 04:04:57 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail25.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id j7L44tI5021732 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 21 Aug 2005 14:04:55 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1]) by cirb503493.alcatel.com.au (8.12.10/8.12.10) with ESMTP id j7L44tSR035637; Sun, 21 Aug 2005 14:04:55 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost) by cirb503493.alcatel.com.au (8.12.10/8.12.9/Submit) id j7L44sXD035636; Sun, 21 Aug 2005 14:04:54 +1000 (EST) (envelope-from pjeremy) Date: Sun, 21 Aug 2005 14:04:54 +1000 From: Peter Jeremy To: Robert Watson Message-ID: <20050821040454.GP13959@cirb503493.alcatel.com.au> References: <20050821003536.P14178@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050821003536.P14178@fledge.watson.org> User-Agent: Mutt/1.4.2i Cc: arch@freebsd.org Subject: Re: [CFR] reflect resolv.conf update to running application X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2005 04:04:58 -0000 Overall, I think that having applications see changes to /etc/resolv.conf is a good idea. On Sun, 2005-Aug-21 00:37:56 +0100, Robert Watson wrote: >(1) Has anyone characterized the significant of the cost of doing a stat() > for every DNS lookup for a significant workload? Does it matter? I wrote a short program to run stat("/etc/resolv.conf") in a loop. On a P-233 running 4.9, I got about 45000 iterations/sec. On a P-120 running 5.4, I got about 10500 iterations/sec. I don't think this matters - especially compared to the overheads involved in sending and receiving the DNS UDP packets. If you are stating the same name frequently, it will be in the name cache so the name lookups are fairly cheap. >(2) By reading the configuration file more frequently and more quickly > after a change, we increase the chances of a race condition in which > the resolve reads a partially written resolv.conf file during an > update. Does this happen in practice? This could be more of an issue, though I have no idea whether it really is. The easy work-around is to avoid updates. Instead create /etc/resolv.conf.tmp and rename it. -- Peter Jeremy