Subject: Re: pwd_mkdb - 29,000 users in 7 Seconds.
To: NetBSD-current Discussion List <current-users@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: current-users
Date: 08/11/2001 15:33:35
"Jeremy C. Reed" wrote:

> > > The real world doesn't work that way.  For the general purpose system
> > > both /etc/passwd and /etc/master.passwd must also be kept up-to-date for
> > > non-DB-capable programs which access their contents (awk, cut, sed, etc.).
> > 
> > Wasn't the point that the password field in /etc/passwd doesn't get updated,
> > so why rebuild the entire file when the password field changes in the shadow
> > file?
> 
> Not just passwords getting changed, but shells and other fields.
> 
> > Or did I miss something in this thread?
> 
> The problem is that it takes a long time to generate the /etc/pwd.db and
> /etc/spwd.db files when there are many users.

As a quick test, I commented out the calls to putdbent() in pwd_mkdb(8)
and did some tests on a 24336 line master.passwd file.  With the calls
to putdbent() enabled it took approx 56 seconds to rebuild passwd,
pwd.db and spwd.db.  Without those calls it took about 1.3 seconds to
rebuild passwd.  This was on a 500MHz AlphaPC164.

So..  It appears that the overheads of rebuilding the (text) passwd file
is not large in the scheme of things.  As Andrew Gillham mentions, this
can even be optimised away for a straight password-only change.  If Andy
Doran is happy to commit his patch (as he has said he is) then we would
appear to have run out of things to argue about, right?

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/