pw add user slow
Valeri Galtsev
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:
>
>>
>> Hi,
>>
>> 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
> text
> 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.
Valeri
>
> --
> Steve O'Hara-Smith <steve at sohara.org>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"
>
++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++
More information about the freebsd-questions
mailing list