Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 1996 21:02:38 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        julian@ref.tfs.com, rashid@rk.ios.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: pwd_mkdb - really slow :(
Message-ID:  <199603041002.VAA05866@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> 	I have quite afew systems here with ~10.00 accounts
>> 	on ea ... and pwd_mkdb is _very slow now ... Takes
>> 	2+ minutes to rebuild the damn databases every time.

I have only 14 accounts (12 distribution ones, bde and ftp), so
I created dummy master.passwd files with thousands of accounts
named "nobodyNNNNN" (NNNN = 0-29999) to test this.  A real
password file may take longer.

On a P133, for 15014 accounts, `pwd_mkd -d /usr/tmp /usr/tmp/dummy_passwd'
took about 39 seconds real, 3 user, 4 sys.  For 30014 accounts, it took
about 234 seconds real, 7 user, 16 sys.  The main problem is obviously
that the disk cache doesn't really work.  ufs writes full blocks as soon
as possible.  This gives very poor performance for random writes if the
same block is written many times.  db often does this.  I think it can
be programmed to do more buffering in memory, but often isn't.  kvm_mkdb
was speeded up by a factor of about 5 by rewriting it to use mmap and
more buffering; now it is only about twice as slow as the old version
would be with a working disk cache ;-).

>it might also be quicker to build the entire databse in ram 
>and bang it out to disk as a single write.. :)

Not much, if write() is suitably buffered.

Bruce



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