pw add user slow
galtsev at kicp.uchicago.edu
Tue Oct 18 12:46:15 UTC 2016
On Tue, October 18, 2016 1:44 am, Steve O'Hara-Smith wrote:
> On Mon, 17 Oct 2016 23:36:33 +0100
> Paul Macdonald <paul at ifdnrg.com> wrote:
>> I have to migrate an imap server, which uses about 6000 local accounts
>> for mail delivery
>> I'm using a script that creates system acounts using:
>> /usr/sbin/pw adduser $LOCAL_USER -u$UID-gGID-d $PATH -s/bin/false
>> I'm finding this grows ever more slow, up to 10 seconds per account on a
>> SATA box , and on a test SSD box ( 20 acc's per second initially) even
>> that slows to about 1 account created per second.
>> why does this slow down as more accounts are added?
> Because for each one it updates text files (passwd and
> master.passwd) and regenerates databases (pwd.db and spwd.db) from the
> files. The fastest way to do this sort of thing is to directly update
> passwd and master.passwd and then run pwd_mkdb.
It appears to be sufficient to only edit master.passwd; pwd_mkdb will
re-generate passwd file from master.passwd.
> Steve O'Hara-Smith <steve at sohara.org>
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
More information about the freebsd-questions