Date: Tue, 18 Oct 2016 14:31:58 +0100 From: Steve O'Hara-Smith <steve@sohara.org> To: galtsev@kicp.uchicago.edu Cc: freebsd-questions@freebsd.org Subject: Re: pw add user slow Message-ID: <20161018143158.792fc79ebfb7edc4ee0c4ecd@sohara.org> In-Reply-To: <60719.69.209.239.247.1476794773.squirrel@cosmo.uchicago.edu> References: <fd1e578c-58ef-5098-9d89-c3db814d7af4@ifdnrg.com> <20161018074415.0f6575675db30d0b83d9b8ec@sohara.org> <60719.69.209.239.247.1476794773.squirrel@cosmo.uchicago.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Oct 2016 07:46:13 -0500 (CDT) "Valeri Galtsev" <galtsev@kicp.uchicago.edu> wrote: > > 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@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. Quite right - it's been a while since I last did this. -- Steve O'Hara-Smith
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161018143158.792fc79ebfb7edc4ee0c4ecd>