Re: [CFR] reflect resolv.conf update to running application
From: Peter Jeremy (PeterJeremy_at_optushome.com.au)
Date: 08/21/05
- Previous message: Robert Watson: "Re: [CFR] reflect resolv.conf update to running application"
- In reply to: Robert Watson: "Re: [CFR] reflect resolv.conf update to running application"
- Next in thread: Hajimu UMEMOTO: "Re: [CFR] reflect resolv.conf update to running application"
- Reply: Hajimu UMEMOTO: "Re: [CFR] reflect resolv.conf update to running application"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 21 Aug 2005 14:04:54 +1000 To: Robert Watson <rwatson@freebsd.org>
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 _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Robert Watson: "Re: [CFR] reflect resolv.conf update to running application"
- In reply to: Robert Watson: "Re: [CFR] reflect resolv.conf update to running application"
- Next in thread: Hajimu UMEMOTO: "Re: [CFR] reflect resolv.conf update to running application"
- Reply: Hajimu UMEMOTO: "Re: [CFR] reflect resolv.conf update to running application"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]