From owner-freebsd-questions Tue Aug 7 21:36:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.freebsd-corp-net-guide.com (mail.freebsd-corp-net-guide.com [206.29.169.15]) by hub.freebsd.org (Postfix) with ESMTP id 6C04537B403 for ; Tue, 7 Aug 2001 21:36:26 -0700 (PDT) (envelope-from tedm@toybox.placo.com) Received: from tedm.placo.com (nat-rtr.freebsd-corp-net-guide.com [206.29.168.154]) by mail.freebsd-corp-net-guide.com (8.11.1/8.11.1) with SMTP id f784aA808126; Tue, 7 Aug 2001 21:36:10 -0700 (PDT) (envelope-from tedm@toybox.placo.com) From: "Ted Mittelstaedt" To: "dannyman" , "=?iso-8859-1?B?Qmr2cm4gVPZybnF2aXN0?=" Cc: Subject: RE: Speeding up account-adding? Date: Tue, 7 Aug 2001 21:36:09 -0700 Message-ID: <000901c11fc3$a5800980$1401a8c0@tedm.placo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <20010807020039.A14999@toldme.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >-----Original Message----- >From: owner-freebsd-questions@FreeBSD.ORG >[mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of dannyman >Sent: Tuesday, August 07, 2001 2:01 AM >To: Björn Törnqvist >Cc: freebsd-questions@FreeBSD.ORG >Subject: Re: Speeding up account-adding? > > >On Tue, Aug 07, 2001 at 10:08:55AM +0200, Björn Törnqvist wrote: > >> At work, we need to add 100k+ loginaccounts on a single system, but >> I've found that after about 15k accounts it takes ~5 seconds to add it >> (through pw useradd). My guess is that its the pwmkdb that is slowing >> things down at an exponetial rate - anyone know how to fix this? >> >> Please reply to me as I'm not a member of the list. > >You would labotomize pw to not call pwd_mkdb, and then carefully feed pw >incremented UIDs, and then run pwd_mkdb when you are done. :) > >http://www.daemonnews.org/199905/user-mgmt.html > Only caution here is check this out, lines 113-117 of /usr/src/usr.sbin/pwd_mkdb/pw_scan.c (FreeBSD 4.2) if (pw_big_ids_warning && id > USHRT_MAX) { warnx("%s > recommended max uid value (%u)", p, USHRT_MAX); /*return (0);*/ /* THIS SHOULD NOT BE FATAL! */ } pw->pw_uid = id; Be warned, going over 65536 is territory some programs won't work with. I know that older Solaris versions used 16 bits for the UID. adduser is even more conservative, it's default is 32000 Many people use SQL databases for authentication of users in the hundreds of thousands. Ted Mittelstaedt tedm@toybox.placo.com Author of: The FreeBSD Corporate Networker's Guide Book website: http://www.freebsd-corp-net-guide.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message