Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2003 21:20:57 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Tim Kientzle <kientzle@acm.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: 40% slowdown with dynamic /bin/sh
Message-ID:  <20031203032057.GC64382@dan.emsphone.com>
In-Reply-To: <3FCD32DB.4030204@acm.org>
References:  <200311250106.hAP16qNp018512@realtime.exit.com> <200311251212.59933.doconnor@gsoft.com.au> <3FCCF094.5040006@tcoip.com.br> <3FCD0774.60807@acm.org> <20031202221940.GF38911@luke.immure.com> <3FCD32DB.4030204@acm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Dec 02), Tim Kientzle said:
> Does that rule out NIS with a static root?
> 
> Yes, with the current NSS/PAM implementation, although a variety of
> suggestions have been floated around that would make NSS/PAM
> compatible with static binaries.  My personal favorite is to
> implement NSS/PAM daemons to satisfy such requests.  Such daemons are
> surprisingly simple to implement, in my experience.  I'm skeptical of
> efforts to use dlopen() with static binaries; static binaries don't
> have symbol tables, so there's no way to resolve references from the
> dlopen()-ed library back into the executable.
> 
> I'm curious, though.  The single most convincing argument so far in
> favor of a static root has been performance.  Doesn't the NIS network
> overhead swamp any performance gains from static linking?  I suspect
> you have other reasons for wanting a static root.  (Or do you only
> require certain executables to be static, such as /bin/sh?)

The programs in /bin or /sbin that link the NIS stuff in don't use it
all that often (rm, for example, will only do a user_from_uid call in
the -i case for a file not owned by the deleter), and unaccessed pages
in a static executable cause no performance hit.  I'm not sure that any
program in /bin or /sbin really does enough lookups for it to be a
speed factor.  Quite a few of the ones that pull in the NIS code really
do it for resolving hostnames.  /bin/sh is the best argument for an
external NSS lookup agent, since it should be fast but occasionally may
want to do NSS calls.

To list programs that pull in NIS:

ident /bin/* /sbin/* | awk '/^[^ ]/ { cmd=$1 } /nsdispatch/ { print cmd }' 

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031203032057.GC64382>