Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2001 21:36:09 -0700
From:      "Ted Mittelstaedt" <tedm@toybox.placo.com>
To:        "dannyman" <dannyman@toldme.com>, "=?iso-8859-1?B?Qmr2cm4gVPZybnF2aXN0?=" <bjorn.tornqvist@west.se>
Cc:        <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Speeding up account-adding?
Message-ID:  <000901c11fc3$a5800980$1401a8c0@tedm.placo.com>
In-Reply-To: <20010807020039.A14999@toldme.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>-----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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000901c11fc3$a5800980$1401a8c0>